com.atlassian.jira.user.util.UserUtil |
![]() |
Clients of @PublicApi
can expect
that programs compiled against a given version will remain binary compatible with later versions of the
@PublicApi
as per each product's API policy as long as the client does not implement/extend
@PublicApi
interfaces or classes (refer to each product's API policy for the exact
guarantee---usually binary compatibility is guaranteed at least across minor versions).
@PublicApi
interfaces and classes are not designed to be implemented or extended by clients,
we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not
affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces
annotated with @PublicSpi
are safe to extend/implement).
This is a back end service level interface that defines an API for user level operations.
In general, appropriate managers or services should be used in preference to this class, as it will be removed in some future revision of JIRA.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
UserUtil.PasswordResetToken | |||||||||||
UserUtil.PasswordResetTokenValidation |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | META_PROPERTY_PREFIX |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
Use
validateAddUserToApplication(ApplicationUser, ApplicationKey) then
addUserToApplication(AddUserToApplicationValidationResult) instead. Since v7.0.
| |||||||||||
This is used to add a specified user to a specified group.
| |||||||||||
This is used to add a user to many groups at once.
| |||||||||||
This method is deprecated.
Use
hasSeatsAvailable(ApplicationKey, int)
instead. Since v7.0
| |||||||||||
Can be called to set the password for a user.
| |||||||||||
This method is deprecated.
since 6.5. Use
flush() instead.
| |||||||||||
This method is deprecated.
Use
createUser(CreateUserValidationResult) instead. Since v7.0.
| |||||||||||
This method is deprecated.
Use
createUser(CreateUserValidationResult) instead. Since v7.0.
| |||||||||||
This method is deprecated.
Use
createUser(CreateUserValidationResult) instead. Since v7.0.
| |||||||||||
This method is deprecated.
Use
createUser(CreateUserValidationResult) instead. Since v7.0.
| |||||||||||
This method is deprecated.
Use
createUser(CreateUserValidationResult) instead. Since v7.0.
| |||||||||||
This is used to generate a reset password token that last a certain time and allows a person to access a page
anonymously so they can reset their password.
| |||||||||||
This method is deprecated.
use
totalBillableUsers() . since 6.5
| |||||||||||
This method is deprecated.
Since v4.3. Use
getJiraAdministrators() .
| |||||||||||
This method is deprecated.
Use
getAllApplicationUsers() instead. Since v6.5.
| |||||||||||
Returns a collection of
User objects that belong to any of the passed in collection of group names. | |||||||||||
Returns a collection of
User objects that belong to any of the passed in collection of group names. | |||||||||||
Retrieve a collection of ProjectComponents - where the lead of each component is the specified user.
| |||||||||||
Takes the given user and returns a "displayable name" by cautiously checking the different edge cases for users.
| |||||||||||
This method is deprecated.
Since v4.3. Use
getGroup(java.lang.String) instead.
| |||||||||||
Returns a collection of the names of the groups that the user belongs to.
| |||||||||||
This method is deprecated.
since 6.5. Use
getGroup(java.lang.String) instead.
| |||||||||||
Returns a collection of
Group objects that the user belongs to. | |||||||||||
Returns a list of JIRA admin
User s. | |||||||||||
Returns a list of JIRA system admin
User s. | |||||||||||
Returns number of issues assigned to user
| |||||||||||
Returns number of issues reported by user
| |||||||||||
Returns all the projects that leadUser is the project lead for.
| |||||||||||
This method is deprecated.
Since v4.3. Use
getJiraSystemAdministrators() .
| |||||||||||
This method is deprecated.
Use
getTotalUserCount() instead. Since 7.0.
| |||||||||||
This method is deprecated.
Use
getUserByKey(String) or getUserByName(String) instead. Since v6.0.
| |||||||||||
This method is deprecated.
use
getUserByKey(String) . since 7.0
| |||||||||||
This method is deprecated.
use
getUserByName(String) . since 7.0
| |||||||||||
This method is deprecated.
Use
getUserByKey(String) or getUserByName(String) instead. Since v6.0.
| |||||||||||
This method is deprecated.
Use
getAllApplicationUsers() instead. Since v6.5.
| |||||||||||
This method is deprecated.
Use
getAllUsersInGroupNames(java.util.Collection) instead. Since v4.3
| |||||||||||
This method is deprecated.
Use
getAllUsersInGroups(java.util.Collection) instead. Since v4.3
| |||||||||||
Checking if user without SYSTEM_ADMIN rights tries to remove user with SYSTEM_ADMIN rights.
| |||||||||||
This will remove the user and removes the user from all the groups.
| |||||||||||
This is used to remove a specified user from a specified group.
| |||||||||||
This is used to remove a user from many groups at once.
| |||||||||||
Returns true if the a user exists with the specified userName
| |||||||||||
This can be called to validate a token against the user.
|
This method is deprecated.
Use validateAddUserToApplication(ApplicationUser, ApplicationKey)
then
addUserToApplication(AddUserToApplicationValidationResult)
instead. Since v7.0.
Takes the given user and adds him/her to all the groups that grant a user the global JIRA use permission. (see
USE
) Note: operation is only performed if by doing so we will not
exceed the user limit (if the current license happens to specify a limit)
user | The user to be added to the USE permission |
---|
PermissionException |
---|
This is used to add a specified user to a specified group. The user will be added to the group if the user is not already a member of the group.
group | the group to add the user to. |
---|---|
userToAdd | the user to add to the group. |
AddException | |
---|---|
PermissionException |
This is used to add a user to many groups at once.
groups | a list containing the groups to add the user to. |
---|---|
userToAdd | the user to add to the group. |
AddException | |
---|---|
PermissionException |
This method is deprecated.
Use hasSeatsAvailable(ApplicationKey, int)
instead. Since v7.0
Returns true if, after adding the specified number of users, the number of active users in JIRA does not exceed the user limit allowed by the license. If the license does not require a user limit, this method will return true immediately.
numUsers | the number of users to add to the JIRA instance. If 0, all things being equal, this method will return true. Must not be negative! |
---|
Can be called to set the password for a user. This will delete any password request tokens associated with that user
user | the user in play |
---|---|
newPassword | their new password |
UserNotFoundException | if the user does not exist |
---|---|
InvalidCredentialException | if the password is invalid |
OperationNotPermittedException | if the underlying User Directory is read-only |
PermissionException |
This method is deprecated.
since 6.5. Use flush()
instead.
Clears the cache of the active user count so that it can be recalculated. This method should be used when performing operations that will modify the number of active users in the system.
@Internal
classes and interfaces can not expect to be compatible with any version
other than the version they were compiled against (even minor version and milestone releases may break binary
compatibility with respect to @Internal
elements).
@Internal
or @PublicApi
.
This method is deprecated.
Use createUser(CreateUserValidationResult)
instead. Since v7.0.
This method is being removed - Please use UserService
.
Creates a JIRA user.
userData | user request containing user details. |
---|---|
sendEmail | should send email notification. |
eventType | notification event type (see to UserEventType ). |
applicationKeys | applications that user should be granted access to,
null if instance default applications should be used,
empty Set when user does not require access to any applications. |
PermissionException | If the operation was not permitted. |
---|---|
CreateException | Unable to create user. |
This method is deprecated.
Use createUser(CreateUserValidationResult)
instead. Since v7.0.
Creates a User from supplied details.
No email notification will be send to created user.
username | The username of the new user. Needs to be lowercase and unique. |
---|---|
password | The password for the new user. |
emailAddress | The email for the new user. Needs to be a valid email address. |
displayName | The display name for the new user |
PermissionException | If the operation was not permitted. |
---|---|
CreateException |
This method is deprecated.
Use createUser(CreateUserValidationResult)
instead. Since v7.0.
Creates a User from supplied details.
No email notification will be send to created user.
username | The username of the new user. Needs to be lowercase and unique. |
---|---|
password | The password for the new user. |
emailAddress | The email for the new user. Needs to be a valid email address. |
displayName | The display name for the new user |
directoryId | The directory to create the user in. Null means "first writable directory". |
PermissionException | If the operation was not permitted. |
---|---|
CreateException |
This method is deprecated.
Use createUser(CreateUserValidationResult)
instead. Since v7.0.
Creates a User from supplied details.
Email notification will be send to created user.
username | The username of the new user. Needs to be lowercase and unique. |
---|---|
password | The password for the new user. |
The email for the new user. Needs to be a valid email address. | |
fullname | The full name for the new user |
directoryId | The directory to create the user in. Null means "first writable directory". |
userEventType | The event type dispatched on user creation. Either USER_CREATED or USER_SIGNUP |
PermissionException | If the operation was not permitted. |
---|---|
CreateException |
This method is deprecated.
Use createUser(CreateUserValidationResult)
instead. Since v7.0.
Creates a User from supplied details.
Email notification will be send to created user.
username | The username of the new user. Needs to be lowercase and unique. |
---|---|
password | The password for the new user. |
The email for the new user. Needs to be a valid email address. | |
fullname | The full name for the new user |
userEventType | The event type dispatched on user creation. Either USER_CREATED or USER_SIGNUP |
PermissionException | If the operation was not permitted. |
---|---|
CreateException |
This is used to generate a reset password token that last a certain time and allows a person to access a page anonymously so they can reset their password.
The generated token will be associated with the named user so that that this information can be verified at a later time.
user | the user in question. This MUST not be null |
---|
This method is deprecated.
use totalBillableUsers()
. since 6.5
Gets the number of active users who currently count towards the license and should be charged for. This method should be used when determining user counts for billing purposes, such as purchase tier recommendations for plugins, and by plugins who wish to enforce tier-based licenses.
In all cases this method will exclude Connect users from the count. In Cloud this will also exclude users who exist for the purpose of providing support (such as the Atlassian sysadmin user).
This method is deprecated.
Since v4.3. Use getJiraAdministrators()
.
Returns a list of JIRA admin User
s.
WARNING: This method will be changed in the future to return a Collection of Crowd User
objects. Since v4.3.
User
s.
This method is deprecated.
Use getAllApplicationUsers()
instead. Since v6.5.
Returns the all users defined in JIRA, regardless of whether they are active or not.
Returns a collection of User
objects that belong to any of the passed in collection of group names.
Prefer using getAllUsersInGroupNamesUnsorted(java.util.Collection)
and sorting the list of users only if
absolutely necessary rather than relying on this method to perform the sort.
groupNames | a collection of group name strings |
---|
UserCachingComparator
order
Returns a collection of User
objects that belong to any of the passed in collection of group names.
groupNames | a collection of group name strings |
---|
Returns a collection of User
objects that are found within the passed in collection of Group
objects.
groups | a collection of Group objects |
---|
UserCachingComparator
order
Retrieve a collection of ProjectComponents - where the lead of each component is the specified user.
user | User leading components |
---|
Takes the given user and returns a "displayable name" by cautiously checking the different edge cases for users.
user | the user. May be null. |
---|
This method is deprecated.
Since v4.3. Use getGroup(java.lang.String)
instead.
Returns a Group
based on group name.
groupName | the user name of the group |
---|
Returns a collection of the names of the groups that the user belongs to.
userName | A User name |
---|
This method is deprecated.
since 6.5. Use getGroup(java.lang.String)
instead.
Returns a Group
based on group name.
groupName | the user name of the group |
---|
Returns a collection of Group
objects that the user belongs to.
userName | A User name |
---|
Returns a list of JIRA system admin User
s.
WARNING: This method will be changed in the future to return a Collection of Crowd User
objects. Since v4.3.
User
's that are associated with the SYSTEM_ADMIN
permission.Returns number of issues assigned to user
loggedInUser | the logged in user |
---|---|
user | the user to find the issue count for |
SearchException | if something goes wrong |
---|
Returns number of issues reported by user
loggedInUser | the logged in user |
---|---|
user | the user to find the issue count for |
SearchException | if something goes wrong |
---|
Returns all the projects that leadUser is the project lead for.
user | the user in play |
---|
This method is deprecated.
Since v4.3. Use getJiraSystemAdministrators()
.
Returns a list of JIRA system admin User
s.
WARNING: This method will be changed in the future to return a Collection of Crowd User
objects. Since v4.3.
User
's that are associated with the SYSTEM_ADMIN
permission.
This method is deprecated.
Use getTotalUserCount()
instead. Since 7.0.
Returns the total number of users defined in JIRA, regardless of whether they are active or not.
This method is deprecated.
Use getUserByKey(String)
or getUserByName(String)
instead. Since v6.0.
Returns a user based on user name.
userName | the user name of the user |
---|
This method is deprecated.
use getUserByKey(String)
. since 7.0
Returns a user based on key.
userkey | the key of the user |
---|
This method is deprecated.
use getUserByName(String)
. since 7.0
Returns a user based on user name.
username | the user name of the user |
---|
This method is deprecated.
Use getUserByKey(String)
or getUserByName(String)
instead. Since v6.0.
Returns a user based on user name.
userName | the user name of the user |
---|
This method is deprecated.
Use getAllApplicationUsers()
instead. Since v6.5.
Returns the all users defined in JIRA, regardless of whether they are active or not.
This method is deprecated.
Use getAllUsersInGroupNames(java.util.Collection)
instead. Since v4.3
Returns a collection of User
objects that are found within the passed in collection of group names. Null
users are excluded even if they exist in the underlying data.
groupNames | a collection of group name strings |
---|
This method is deprecated.
Use getAllUsersInGroups(java.util.Collection)
instead. Since v4.3
Returns a collection of User
objects that are found within the passed in collection of Group
objects. Null users are excluded even if they exist in the underlying data.
groups | a collection of Group objects |
---|
UserCachingComparator
orderChecking if user without SYSTEM_ADMIN rights tries to remove user with SYSTEM_ADMIN rights.
loggedInUser | User performing operation |
---|---|
user | User for remove |
This will remove the user and removes the user from all the groups. All components lead by user will have lead cleared.
loggedInUser | the user performing operation |
---|---|
user | the user to delete |
This is used to remove a specified user from a specified group. The user will be removed from the group only if the user is already a member of the group.
group | the group to add the user to. |
---|---|
userToRemove | the user to add to the group. |
This is used to remove a user from many groups at once.
groups | a list containing the groups to add the user to. |
---|---|
userToRemove | the user to add to the group. |
Returns true if the a user exists with the specified userName
userName | the name of the user |
---|
This can be called to validate a token against the user.
user | the user in play |
---|---|
token | the token they provided |