com.atlassian.jira.user.util.UserManager |
Known Indirect Subclasses |
Simple user utilities that do not require an implementation with too many dependencies.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
UserManager.UserState | The current state of a user with regard to the same username existing in other user directories. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Checks if the given directory is able to update user passwords.
| |||||||||||
Test if this user can be renamed.
| |||||||||||
Test if this user's group membership can be updated, i.e.
| |||||||||||
This method is deprecated.
Use
canUpdateUser(ApplicationUser) instead. Since v6.0.
| |||||||||||
Test if this user can be updated, i.e.
| |||||||||||
Test if this user's password can be updated, i.e.
| |||||||||||
Returns a
User based on user name and directoryId | |||||||||||
Returns all users defined in JIRA, regardless of whether they are active or not.
| |||||||||||
Returns all groups defined in JIRA.
| |||||||||||
Returns all users defined in JIRA, regardless of whether they are active or not.
| |||||||||||
Returns a
Group based on user name. | |||||||||||
Returns a
Group based on user name. | |||||||||||
Returns all groups defined in JIRA.
| |||||||||||
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 an
ApplicationUser based on user key. | |||||||||||
Returns an
ApplicationUser based on user key. | |||||||||||
Returns an
ApplicationUser based on user name. | |||||||||||
Returns an
ApplicationUser based on user name. | |||||||||||
This method is deprecated.
Use
getUserByKeyEvenWhenUnknown(String) or getUserByNameEvenWhenUnknown(String) instead. Since v6.0.
| |||||||||||
This method is deprecated.
Use
getUserByKey(String) or getUserByName(String) instead. Since v6.0.
| |||||||||||
This convenience method is equivalent to
getUserState(user.getUsername(), user.getDirectoryId())
except that a null user is permitted and returns INVALID_USER . | |||||||||||
Checks for the existence of this user across all directories to determine
whether or not the user exists in the specified directory and whether or not
it is shadowing or shadowed by a user with the same username in another
active user directory.
| |||||||||||
This convenience method is equivalent to
getUserState(user.getName(), user.getDirectoryId())
except that a null user is permitted and returns INVALID_USER . | |||||||||||
Returns all users defined in JIRA, regardless of whether they are active or not.
| |||||||||||
Returns an ordered list of directories that have "read-write" permission.
| |||||||||||
Returns true if any of the directories have permission to update groups.
| |||||||||||
Returns true if any of the directories have permission to update user passwords, false if otherwise.
| |||||||||||
Returns true if at least one User Directory has "read-write" permission.
| |||||||||||
Checks if given user is existing user
| |||||||||||
Updates the
User . | |||||||||||
Updates the
ApplicationUser . |
Checks if the given directory is able to update user passwords.
directory | the Directory |
---|
Test if this user can be renamed. In addition to the constraints of canUpdateUser(ApplicationUser)
,
renaming a user is only allowed when:
INTERNAL
or DELEGATING
user directory;
ANDJIRA_OPTION_USER_CROWD_ALLOW_RENAME
is enabled to bypass this check.user | The user to rename. |
---|
null
and can be renamed.Test if this user's group membership can be updated, i.e. is in a writable directory or a directory with Local Group support. This relies upon the local directory configuration and does not guarantee that the actual remote directory, e.g. the remote LDAP directory, will actually allow the user membership to be updated.
user | The user to update. |
---|
null
and can be updated.
This method is deprecated.
Use canUpdateUser(ApplicationUser)
instead. Since v6.0.
Test if this user can be updated, i.e. is in a writable directory. This relies upon the local directory configuration and does not guarantee that the actual remote directory, e.g. the remote LDAP directory, will actually allow the user to be updated.
If the "External user management" setting is on, then you cannot update the user.
user | The user to update. |
---|
null
and can be updated.Test if this user can be updated, i.e. is in a writable directory. This relies upon the local directory configuration and does not guarantee that the actual remote directory, e.g. the remote LDAP directory, will actually allow the user to be updated.
If the "External user management" setting is on, then you cannot update the user.user | The user to update. |
---|
null
and can be updated.
Test if this user's password can be updated, i.e. is in a writable directory which is not a Delegated LDAP directory. This relies upon the local directory configuration and does not guarantee that the actual remote directory, e.g. the remote LDAP directory, will actually allow the user to be updated.
If the "External user management", or "External password management" setting is on, then you cannot update the password.
user | The user to update. |
---|
null
and the user's password can be updated.
Returns a User
based on user name and directoryId
userName | the user name of the user |
---|---|
directoryId | the Directory to look in |
Returns all users defined in JIRA, regardless of whether they are active or not.
Returns all groups defined in JIRA.
Warning: previous incarnations of this method returnedcom.opensymphony.user.User
. This class
has now been removed from the JIRA API, meaning that the 5.0 version is not binary or source compatible with
earlier versions.Returns all users defined in JIRA, regardless of whether they are active or not.
Returns a Group
based on user name.
com.opensymphony.user.User
. This class
has now been removed from the JIRA API, meaning that the 5.0 version is not binary or source compatible with
earlier versions.groupName | the user name of the group |
---|
Returns a Group
based on user name.
getGroup(String)
.groupName | the user name of the group |
---|
Returns all groups defined in JIRA.
Legacy synonym forgetAllGroups()
.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 an ApplicationUser
based on user key.
userKey | the key of the user |
---|
Returns an ApplicationUser
based on user key.
isUserExisting(com.atlassian.jira.user.ApplicationUser)
userKey | the key of the user |
---|
Returns an ApplicationUser
based on user name.
userName | the user name of the user |
---|
IllegalStateException | if the CrowdService
is able to resolve userName to a User , but the
UserKeyService does not have a key mapped for it.
This is not a valid configuration. |
---|
Returns an ApplicationUser
based on user name.
isUserExisting(com.atlassian.jira.user.ApplicationUser)
userName | the user name of the user |
---|
IllegalStateException | if the CrowdService
is able to resolve userName to a User , but the
UserKeyService does not have a key mapped for it.
This is not a valid configuration. |
---|
This method is deprecated.
Use getUserByKeyEvenWhenUnknown(String)
or getUserByNameEvenWhenUnknown(String)
instead. Since v6.0.
Returns a User
based on user name.
If a null username is passed, then a null User object is returned, but it is guaranteed to return a non-null User in all other cases.
If the username is not null, but the User is not found then a proxy unknown immutable User object is returned.
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 |
---|
@Internal
or @PublicApi
.
This convenience method is equivalent to
getUserState(user.getUsername(), user.getDirectoryId())
except that a null
user is permitted and returns INVALID_USER
.
user | the user to check |
---|
@Internal
or @PublicApi
.
Checks for the existence of this user across all directories to determine whether or not the user exists in the specified directory and whether or not it is shadowing or shadowed by a user with the same username in another active user directory.
username | the username to check |
---|---|
directoryId | the directory ID of the user directory that the user came from |
@Internal
or @PublicApi
.
This convenience method is equivalent to
getUserState(user.getName(), user.getDirectoryId())
except that a null
user is permitted and returns INVALID_USER
.
user | the user to check |
---|
Returns all users defined in JIRA, regardless of whether they are active or not.
Legacy synonym forgetAllUsers()
.Returns an ordered list of directories that have "read-write" permission. ie those directories that we can add a user to.
Returns true if any of the directories have permission to update groups.
Note that this will not always return the same results as hasWritableDirectory()
because you can set "Read-Only with Local Groups" to LDAP directories.
These directories are generally read-only but you can create local gropus and assign users to them.
Returns true if any of the directories have permission to update user passwords, false if otherwise.
Note that this is not quite the same as hasWritableDirectory()
because of "Internal with LDAP Authentication" directories.
These directories are generally read-write but passwords are read-only.
Returns true if at least one User Directory has "read-write" permission.
This is equivalent to:
getWritableDirectories().size() > 0
Checks if given user is existing user
user | possible existing user object - i.e. recieved from getUserByKeyEvenWhenUnknown(String) or getUserByNameEvenWhenUnknown(String) |
---|
true
if given user is real user, false
otherwise (also when given object is null
)Updates the User
. The user must have non-null names and email address.
user | The user to update. |
---|
UserNotFoundException | If the supplied user does not exist in the directory . |
---|---|
OperationFailedException | If the underlying directory implementation failed to execute the operation. |
IllegalArgumentException | If something is wrong with the provided user object |
Updates the ApplicationUser
. The user must have non-null names and email address. If the user's name
does not match the name that is currently associated with the key
, then
this is implicitly treated as a request to rename the user.
user | The user to update. |
---|
UserNotFoundException | If the supplied user does not exist in the directory . |
---|---|
OperationFailedException | If the underlying directory implementation failed to execute the operation. |
IllegalArgumentException | If something is wrong with the provided user object |