com.atlassian.jira.user.util.UserUtil |
Known Indirect Subclasses |
This is a back end service level interface that defines an API for user level operations.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
UserUtil.PasswordResetToken | |||||||||||
UserUtil.PasswordResetTokenValidation |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | META_PROPERTY_PREFIX |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Takes the given user and adds him/her to all the groups that grant a user the global JIRA use permission.
| |||||||||||
This is used to add a specified user to a specified group.
| |||||||||||
This is used to add a user to many groups at once.
| |||||||||||
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.
| |||||||||||
Returns true if, after adding the specified users, the number of active users in JIRA does not exceed the user
limit allowed by the license.
| |||||||||||
Can be called to set the password for a user.
| |||||||||||
Clears the cache of the active user count so that it can be recalculated.
| |||||||||||
Creates a User from supplied details.
| |||||||||||
Creates a User from supplied details.
| |||||||||||
Creates a User from supplied details.
| |||||||||||
Creates a User from supplied details.
| |||||||||||
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.
| |||||||||||
Returns the number of users that are currently 'active'.
| |||||||||||
This method is deprecated.
Since v4.3. Use
getJiraAdministrators() .
| |||||||||||
Returns the all users defined in JIRA, regardless of whether they are active or not.
| |||||||||||
This method is deprecated.
Since v4.3. Use
getUsers() .
| |||||||||||
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.
| |||||||||||
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.
| |||||||||||
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
getGroupObject(String) .
| |||||||||||
Returns a collection of the names of the groups that the user belongs to.
| |||||||||||
Returns a
Group based on user name. | |||||||||||
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 assigned to user
| |||||||||||
Returns number of issues reported by user
| |||||||||||
Returns number of issues reported by user
| |||||||||||
Returns all the projects that leadUser is the project lead for.
| |||||||||||
Returns all the projects that leadUser is the project lead for.
| |||||||||||
This method is deprecated.
Since v4.3. Use
getJiraSystemAdministrators() .
| |||||||||||
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 key.
| |||||||||||
Returns a user based on user name.
| |||||||||||
This method is deprecated.
Use
getUserByKey(String) or getUserByName(String) instead. Since v6.0.
| |||||||||||
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
| |||||||||||
This method is deprecated.
Use
getAllUsersInGroups(java.util.Collection) instead. Since v4.3
| |||||||||||
Returns true if this JIRA instance has more active users, than allowed by the license.
| |||||||||||
Checking if user without SYSTEM_ADMIN rights tries to remove user with SYSTEM_ADMIN rights.
| |||||||||||
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 method is deprecated.
Use
removeUser(ApplicationUser, ApplicationUser) instead. Since v6.0.
| |||||||||||
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.
|
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 |
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! |
---|
Returns true if, after adding the specified users, the number of active users in JIRA does not exceed the user limit allowed by the license. If a user specified is already active, or cannot be found, they are not counted towards the user limit. If the limit has already been exceeded, but none of the users specified are inactive, the result will still be true, as these users are already active and thus nothing changes. If the license does not require a user limit, this method will return true immediately.
userNames | the names of the users to add to the JIRA instance. Must not be null! |
---|
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 |
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.
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 |
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 |
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 |
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 |
---|
Returns the number of users that are currently 'active'. For a user to be active, means that it must belong to a
group that has either the JIRA-users, JIRA-administrators or JIRA-Systemadministartors global permission.
Implementations of this method should take performance into consideration, and ensure that the value is cached.
Use clearActiveUserCount()
to clear the cache.
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.Returns the all users defined in JIRA, regardless of whether they are active or not.
This method is deprecated.
Since v4.3. Use getUsers()
.
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 |
---|
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. |
---|
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 getGroupObject(String)
.
Returns a Group
based on user name.
WARNING: This method will be changed in the future to return a Crowd Group
object. Since v4.3.
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 |
---|
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 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 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 |
---|
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.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 |
---|
Returns a user based on key.
userkey | the key of the user |
---|
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 |
---|
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
orderReturns true if this JIRA instance has more active users, than allowed by the license. If the license does not require a user limit, this method will return false immediately.
Checking if user without SYSTEM_ADMIN rights tries to remove user with SYSTEM_ADMIN rights.
loggedInUser | User performing operation |
---|---|
user | User for remove |
Checking 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 method is deprecated.
Use removeUser(ApplicationUser, ApplicationUser)
instead. Since v6.0.
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 |