Package com.atlassian.jira.bc.user
Class UserService.CreateUserRequest
java.lang.Object
com.atlassian.jira.bc.user.UserService.CreateUserRequest
- Enclosing interface:
- UserService
This request contains all the instructions and user details that should be used during user validation and user
creation.
-
Method Summary
Modifier and TypeMethodDescriptionconfirmPassword
(String confirmPassword) Confirm that the provided password matches the confirm password provided.boolean
Determine whether the default user directory should be used for the new user.Set<com.atlassian.application.api.ApplicationKey>
Return the application keys that are used to specify what application access the new user requires.Return the confirmation password that should be compared against thegetPassword()
.Return the directory id (representing the user directory), that the new user should be created in.Return the display name (also known as full name) for the new user.Return the email address for the new user.Return the logged in user that would be performing the user creation.Return the password for the new user.Return the user name that is used to identify the new user.inDirectory
(Long directoryId) Specify what user directory should be used for new user.Specify that the user password is required.performPermissionCheck
(boolean performPermissionCheck) Indicate that the permission check should not be performed on the logged in user to determine whether the logged in user has permission to create the new user.boolean
Determine whether the new user requires default application access.boolean
Determine whether the user password is required.sendNotification
(boolean sendNotification) Specify whether a notification should be sent when the new user has successfully been created.Specify that a user signup event should be sent after user creation.boolean
Determine whether the confirmation password should be validation or whether the confirmation password has been set.boolean
boolean
Determine whether a notification should be sent after user creation.boolean
Determine whether a signup event should be sent after user has been created.Specify that all validations should be skipped.withApplicationAccess
(Set<com.atlassian.application.api.ApplicationKey> applicationKeys) Specify the applications that this user required access to.withEventUserEvent
(int userEventType) Deprecated.Since v7.0.Indicate that no application access is required for the new user.withUserDetails
(ApplicationUser loggedInUser, String username, String password, String emailAddress, String displayName) Create a new user creation request as the provided user for the specified user details.
-
Method Details
-
withUserDetails
public static UserService.CreateUserRequest withUserDetails(@Nullable ApplicationUser loggedInUser, String username, @Nullable String password, String emailAddress, String displayName) Create a new user creation request as the provided user for the specified user details. This request indicates that the new users should be created in the default user directory and have access to the default applications. A Notification would be sent after user creation.- Parameters:
loggedInUser
- application user performing the create. Ifnull
the user creation is being performed during setup or signup.username
- The username of the new user. Needs to be lowercase and unique. Required.password
- The password for the new user. If empty a random password will be generated.emailAddress
- The email address for the new user. Required.displayName
- The display name for the new user. Required.
-
confirmPassword
Confirm that the provided password matches the confirm password provided.- Parameters:
confirmPassword
- the confirm password that should match the provided password.
-
withNoApplicationAccess
Indicate that no application access is required for the new user. -
withApplicationAccess
public UserService.CreateUserRequest withApplicationAccess(@Nonnull Set<com.atlassian.application.api.ApplicationKey> applicationKeys) Specify the applications that this user required access to.- Parameters:
applicationKeys
- applications that user should be granted access to, an empty Set indicates that the user does not require access to any applications.- See Also:
-
sendNotification
Specify whether a notification should be sent when the new user has successfully been created.- Parameters:
sendNotification
- true if notification should be sent after a new user has successfully been created. false if no notification should be sent.
-
sendUserSignupEvent
Specify that a user signup event should be sent after user creation. Typically when the new user is being created during signup. -
passwordRequired
Specify that the user password is required. -
performPermissionCheck
Indicate that the permission check should not be performed on the logged in user to determine whether the logged in user has permission to create the new user.- Parameters:
performPermissionCheck
- true if the permission check should be performed else false to skip the permission check.
-
inDirectory
Specify what user directory should be used for new user.- Parameters:
directoryId
- The directory which the new user is intended to be created in.null
indicates that the default directory should be used.
-
skipValidation
Specify that all validations should be skipped. This should only be used when it does not matter that user gets created or added. -
withEventUserEvent
Deprecated.Since v7.0.This method has been made public only to allow temporary backwards compatibility and will be removed in 7.0.Set the event type to be dispatch after user creation. This has been added for compatibility reasons please avoid using this.
- Parameters:
userEventType
- the event type that should be sent after user has been created.- See Also:
-
requirePassword
public boolean requirePassword()Determine whether the user password is required.- Returns:
- true is user password is required else faslse.
-
getUsername
Return the user name that is used to identify the new user.- Returns:
- the user name that is used to identify the new user.
-
getPassword
Return the password for the new user.- Returns:
- the password for the new user.
-
getDisplayName
Return the display name (also known as full name) for the new user.- Returns:
- the display name (also known as full name) for the new user.
-
getEmailAddress
Return the email address for the new user.- Returns:
- the email address for the new user.
-
defaultDirectory
public boolean defaultDirectory()Determine whether the default user directory should be used for the new user. -
getDirectoryId
Return the directory id (representing the user directory), that the new user should be created in. This is typically left unsetnull
indicating default.- Returns:
- the directory id (representing the user directory), that the new user should be created in.
-
shouldConfirmPassword
public boolean shouldConfirmPassword()Determine whether the confirmation password should be validation or whether the confirmation password has been set.- Returns:
- true if the
confirmPassword(String)
should be compared against thegetPassword()
.
-
getConfirmPassword
Return the confirmation password that should be compared against thegetPassword()
. This is typically set byconfirmPassword(String)
to indicate that the confirm password should be validated against thegetPassword()
.- Returns:
- the confirmation password that should be compared against the
getPassword()
.
-
requireDefaultApplicationAccess
public boolean requireDefaultApplicationAccess()Determine whether the new user requires default application access. Default application access is the configuration that indicates what applications a new user should be added to.- Returns:
- true if the new user should be granted access to the default applications else false.
-
getApplicationKeys
Return the application keys that are used to specify what application access the new user requires.- Returns:
- the application keys that are used to specify what application access the new user requires.
- See Also:
-
shouldSendNotification
public boolean shouldSendNotification()Determine whether a notification should be sent after user creation.- Returns:
- true if a notification should be sent after user creation. false if a notification should not be sent after user creation.
- See Also:
-
shouldSendUserSignupEvent
public boolean shouldSendUserSignupEvent()Determine whether a signup event should be sent after user has been created. This is typically true when the user is being created via signup.- Returns:
- true if a signup event should be sent after user has been created.
-
getLoggedInUser
Return the logged in user that would be performing the user creation.- Returns:
- the application user performing the user creation.
-
shouldPerformPermissionCheck
public boolean shouldPerformPermissionCheck()
-