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.

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.

canUpdateUser

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.

updateUser

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.

Parameters:

user - The user to update.

Throws:

com.atlassian.crowd.exception.runtime.UserNotFoundException - If the supplied user does not exist in the directory.

com.atlassian.crowd.exception.runtime.OperationFailedException - If the underlying directory implementation failed to execute the operation.

canUpdateUserPassword

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.

Parameters:

user - The user to update.

Returns:

true if the user is not null and the user's password can be updated.

canUpdateGroupMembershipForUser

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.

Warning: previous incarnations of this method returned 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.

getGroup

Warning: previous incarnations of this method returned 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.

Parameters:

groupName - the user name of the group

Returns:

the Group object, or null if the group cannot be found including null groupName.

hasGroupWritableDirectory

boolean hasGroupWritableDirectory()

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 groups, false if otherwise.

getUserState

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.

Parameters:

username - the username to check

directoryId - the directory ID of the user directory that the user came from