com.atlassian.confluence.user
Class DefaultUserAccessor

java.lang.Object
  extended by bucket.user.DefaultUserAccessor
      extended by com.atlassian.confluence.user.DefaultUserAccessor
All Implemented Interfaces:
UserAccessor, com.atlassian.user.search.query.EntityQueryParser

public class DefaultUserAccessor
extends DefaultUserAccessor
implements UserAccessor

This implementation of UserAccessor takes care of all the Confluence-related actions around user management: checking permissions, publishing events, and ensuring the integrity of data in Confluence related to users.


Field Summary
 
Fields inherited from class bucket.user.DefaultUserAccessor
DEFAULT_GROUP_NAME, defaultGroup
 
Fields inherited from interface com.atlassian.confluence.user.UserAccessor
ANONYMOUS, DEFAULT_GROUP_NAMES, GROUP_CONFLUENCE_ADMINS, GROUP_CONFLUENCE_USERS, PROFILE_PICTURE_BUILTIN_PATH, USER_GROUP_SUFFIX
 
Constructor Summary
DefaultUserAccessor(com.atlassian.user.configuration.RepositoryAccessor repositoryAccessor, SpacePermissionManager spacePermissionManager, ContentEntityManager contentEntityManager, NotificationManager notificationManager, PersonalInformationManager personalInformationManager, UserChecker userChecker, AttachmentManager attachmentManager, com.atlassian.event.EventManager eventManager, ContentPermissionManager contentPermissionManager, PermissionManager permissionManager, UserStatusManager userStatusManager, FollowManager followManager, com.atlassian.crowd.embedded.api.CrowdService crowdService, DisabledUserManager disabledUserManager, HibernateSessionManager sessionManager, ConfluenceUserDao confluenceUserDao, com.atlassian.user.UserManager backingUserManager, SettingsManager settingsManager, com.atlassian.crowd.embedded.api.UnfilteredCrowdService unfilteredCrowdService, com.google.common.base.Supplier<DarkFeaturesManager> darkFeaturesManagerSupplier)
           
 
Method Summary
 com.atlassian.user.Group addGroup(java.lang.String groupname)
          Adds a group with the specified name.
 void addMembership(com.atlassian.user.Group group, com.atlassian.user.User user)
          Adds the specified user to this group.
 int countLicenseConsumingUsers()
          Returns the number of users which have access to use Confluence AND consume a Confluence license.
 int countUsersWithConfluenceAccess()
           
 com.atlassian.user.Group createGroup(java.lang.String groupname)
          Method was added for consistency.
 com.atlassian.user.User createUser(java.lang.String username)
           
 ConfluenceUser createUser(com.atlassian.user.User userTemplate, com.atlassian.user.security.password.Credential credential)
          
 void deactivateUser(com.atlassian.user.User user)
          Deactivate the specified user, which prevents them logging in.
 boolean exists(java.lang.String name)
          Returns true if a user exists with the given username.
 java.util.List<com.atlassian.user.Group> filterUnaccessibleGroups(java.util.List<com.atlassian.user.Group> groupList, com.atlassian.user.User user)
          Deprecated. Since 5.1. This method no longer does anything, and returns the same list of groups as was passed in.
 com.atlassian.user.search.page.Pager<com.atlassian.user.Group> filterUnaccessibleGroups(com.atlassian.user.search.page.Pager<com.atlassian.user.Group> groupPager, com.atlassian.user.User user)
          Deprecated. Since 5.1. This method no longer does anything, and returns the same list of users as was passed in.
 java.util.List<com.atlassian.user.User> filterUnaccessibleUsers(java.util.List<com.atlassian.user.User> users, com.atlassian.user.User user)
          Deprecated. Since 5.1. This method no longer does anything, and returns the same list of users as was passed in.
 com.atlassian.user.search.page.Pager<com.atlassian.user.User> filterUnaccessibleUsers(com.atlassian.user.search.page.Pager<com.atlassian.user.User> userPager, com.atlassian.user.User user)
          Deprecated. Since 5.1. This method no longer does anything, and returns the same list of users as was passed in.
 java.util.List<com.atlassian.user.User> findUsersAsList(com.atlassian.user.search.query.Query<com.atlassian.user.User> search)
           
 java.util.List<java.lang.String> getAllDefaultGroupNames()
          Deprecated. Since 5.2. This method is vague and returns a collection containing the result of Settings.getDefaultUsersGroup() and UserAccessor.GROUP_CONFLUENCE_ADMINS. Clients should explicitly decide what they need and use that.
 ConfluenceUserPreferences getConfluenceUserPreferences(com.atlassian.user.User user)
           
 ConfluenceUser getExistingUserByKey(com.atlassian.sal.api.user.UserKey key)
          Returns the user with the specified user key, or null if the user doesn't exist or the key is null.
 java.util.List<java.lang.String> getGroupNames(com.atlassian.user.User user)
          Gets the list of group names representing the groups the passed in user is a member of.
 java.util.List<java.lang.String> getGroupNamesForUserName(java.lang.String userName)
          Gets the list of group names representing the groups the passed in user is a member of.
 java.util.List<com.atlassian.user.Group> getGroupsAsList()
           
 java.util.List<com.atlassian.user.Group> getGroupsAsList(com.atlassian.user.User user)
           
 ProfilePictureInfo getLogoForUser(com.atlassian.user.User user)
           
 java.util.List<java.lang.String> getMemberNamesAsList(com.atlassian.user.Group group)
          Same as UserAccessor.getMemberNames(com.atlassian.user.Group) but returns a List of user names as Strings rather than a Pager.
 java.lang.Iterable<ConfluenceUser> getMembers(com.atlassian.user.Group group)
          Returns users who are members of the specified group (either directly or as a member of a nested group).
 java.lang.String getNewUserDefaultGroupName()
          Deprecated. since 5.2. Use Settings.getDefaultUsersGroup() via SettingsManager.getGlobalSettings().
 com.opensymphony.module.propertyset.PropertySet getPropertySet(ConfluenceUser user)
           
 ConfluenceUser getUserByKey(com.atlassian.sal.api.user.UserKey key)
          Returns the user with the specified user key, or null if the user has never existed or the key is null.
 ConfluenceUser getUserByName(java.lang.String name)
          Returns the ConfluenceUser with the supplied user name or null if the user doesn't exist or the supplied name is null.
 com.atlassian.user.User getUserIfAvailable(java.lang.String username)
          Deprecated. since 5.2
 java.util.List<java.lang.String> getUserNamesWithConfluenceAccess()
          Returns the names of all users with access to use Confluence.
 ProfilePictureInfo getUserProfilePicture(java.lang.String username)
          Retrieve the path to a user's personal picture
 ProfilePictureInfo getUserProfilePicture(com.atlassian.user.User user)
          Retrieve the path to a user's personal picture
 com.atlassian.user.search.page.Pager<com.atlassian.user.User> getUsersWithConfluenceAccess()
          Returns all the users with access to use Confluence.
 java.util.List<com.atlassian.user.User> getUsersWithConfluenceAccessAsList()
          Returns all the users which have access to use Confluence.
 java.util.List<com.atlassian.user.Group> getWriteableGroups()
          Gets all editable groups.
 boolean isDeactivated(java.lang.String username)
          Returns true if the user with the specified username exists and is unable to log in, otherwise false.
 boolean isDeactivated(com.atlassian.user.User user)
          Returns true if the user exists and is unable to log in, otherwise false.
 boolean isLicensedToAddMoreUsers()
           
 boolean isReadOnly(com.atlassian.user.Group group)
          Returns true if the group cannot be modified or removed.
 boolean isReadOnly(com.atlassian.user.User user)
          Returns true if the user cannot be modified or removed.
 boolean isSuperUser(com.atlassian.user.User user)
          Return true if the user is an all-powerful super-user (member of the confluence-administrators group).
 void reactivateUser(com.atlassian.user.User user)
          Marks the specified user as active, which allows them to log in.
 void removeGroup(com.atlassian.user.Group group)
          Removes the specified group.
 boolean removeMembership(com.atlassian.user.Group group, com.atlassian.user.User user)
          Removes the specified user from this group.
 void removeUser(com.atlassian.user.User user)
          Removes the specified user.
 ConfluenceUser renameUser(ConfluenceUser user, java.lang.String newUsername)
          Updates the username of the given user.
 void savePersonalInformation(PersonalInformation newInfo, PersonalInformation oldInfo)
           
 void setUserProfilePicture(com.atlassian.user.User user, Attachment attachment)
          Set the user profile picture to the given attachment.
 void setUserProfilePicture(com.atlassian.user.User user, java.lang.String imagePath)
          Set the user profile picture to a built-in image.
 
Methods inherited from class bucket.user.DefaultUserAccessor
addMembership, addUser, addUser, alterPassword, authenticate, findGroups, findGroups, findUsers, findUsers, getAuthenticator, getDelegatingRepositories, getEntityQueryParser, getExternallMembers, getGroup, getGroupCreateIfNecessary, getGroupManager, getGroups, getGroups, getLocalMembers, getMemberNames, getPropertySet, getPropertySetFactory, getRepository, getUser, getUserManager, getUserNames, getUserPreferences, getUsers, getUsersByEmail, hasMembership, hasMembership, isUserRemovable, removeMembership, saveUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.confluence.user.UserAccessor
getPropertySet, getUser
 
Methods inherited from interface bucket.user.UserAccessor
addMembership, addUser, addUser, alterPassword, authenticate, findUsers, getDelegatingRepositories, getExternallMembers, getGroup, getGroupCreateIfNecessary, getGroups, getGroups, getLocalMembers, getMemberNames, getRepository, getUserNames, getUserPreferences, getUsers, getUsersByEmail, hasMembership, hasMembership, isUserRemovable, removeMembership, saveUser
 
Methods inherited from interface com.atlassian.user.search.query.EntityQueryParser
findGroups, findGroups, findUsers
 

Constructor Detail

DefaultUserAccessor

public DefaultUserAccessor(com.atlassian.user.configuration.RepositoryAccessor repositoryAccessor,
                           SpacePermissionManager spacePermissionManager,
                           ContentEntityManager contentEntityManager,
                           NotificationManager notificationManager,
                           PersonalInformationManager personalInformationManager,
                           UserChecker userChecker,
                           AttachmentManager attachmentManager,
                           com.atlassian.event.EventManager eventManager,
                           ContentPermissionManager contentPermissionManager,
                           PermissionManager permissionManager,
                           UserStatusManager userStatusManager,
                           FollowManager followManager,
                           com.atlassian.crowd.embedded.api.CrowdService crowdService,
                           DisabledUserManager disabledUserManager,
                           HibernateSessionManager sessionManager,
                           ConfluenceUserDao confluenceUserDao,
                           com.atlassian.user.UserManager backingUserManager,
                           SettingsManager settingsManager,
                           com.atlassian.crowd.embedded.api.UnfilteredCrowdService unfilteredCrowdService,
                           com.google.common.base.Supplier<DarkFeaturesManager> darkFeaturesManagerSupplier)
Method Detail

isLicensedToAddMoreUsers

public boolean isLicensedToAddMoreUsers()
Specified by:
isLicensedToAddMoreUsers in interface UserAccessor
Overrides:
isLicensedToAddMoreUsers in class DefaultUserAccessor

addMembership

public void addMembership(com.atlassian.user.Group group,
                          com.atlassian.user.User user)
Adds the specified user to this group.

Specified by:
addMembership in interface UserAccessor
Overrides:
addMembership in class DefaultUserAccessor
Throws:
InsufficientPrivilegeException - if the currently logged in user does not have the permissions to add this user to this group. Check permissions using Permission.EDIT on PermissionManager on the group first.

removeMembership

public boolean removeMembership(com.atlassian.user.Group group,
                                com.atlassian.user.User user)
Removes the specified user from this group.

Specified by:
removeMembership in interface UserAccessor
Overrides:
removeMembership in class DefaultUserAccessor
Throws:
InsufficientPrivilegeException - if the currently logged in user does not have the permissions to remove this user from this group. Check permissions using Permission.REMOVE and PermissionManager on the group first.

getUserByName

public ConfluenceUser getUserByName(java.lang.String name)
Description copied from interface: UserAccessor
Returns the ConfluenceUser with the supplied user name or null if the user doesn't exist or the supplied name is null.

Note that user name lookups are case-insensitive, so the user you get back may not have exactly the same name as the name passed to this method.

Parameters:
name - the user name of the user
Returns:
the ConfluenceUser with the supplied user name or null.

getUserByKey

public ConfluenceUser getUserByKey(com.atlassian.sal.api.user.UserKey key)
Description copied from interface: UserAccessor
Returns the user with the specified user key, or null if the user has never existed or the key is null.

WARNING: This method can return deleted users. Use UserAccessor.getExistingUserByKey(com.atlassian.sal.api.user.UserKey) to get only users that exist.


getExistingUserByKey

public ConfluenceUser getExistingUserByKey(com.atlassian.sal.api.user.UserKey key)
Description copied from interface: UserAccessor
Returns the user with the specified user key, or null if the user doesn't exist or the key is null.


exists

public boolean exists(java.lang.String name)
Description copied from interface: UserAccessor
Returns true if a user exists with the given username. This method is significantly faster than getUser(name) != null.

Parameters:
name - username of the user
Returns:
true if a user exists with the given username

createUser

public ConfluenceUser createUser(com.atlassian.user.User userTemplate,
                                 com.atlassian.user.security.password.Credential credential)
Description copied from interface: UserAccessor

Specified by:
createUser in interface UserAccessor
Overrides:
createUser in class DefaultUserAccessor

createUser

public com.atlassian.user.User createUser(java.lang.String username)
Specified by:
createUser in interface UserAccessor
Overrides:
createUser in class DefaultUserAccessor

addGroup

public com.atlassian.user.Group addGroup(java.lang.String groupname)
Adds a group with the specified name.

Specified by:
addGroup in interface UserAccessor
Overrides:
addGroup in class DefaultUserAccessor
Returns:
the group created
Throws:
InsufficientPrivilegeException - if the current user does not have permission to add this group

createGroup

public com.atlassian.user.Group createGroup(java.lang.String groupname)
Method was added for consistency. We will need to decide whether we want to lowercase all group names upon creation. Currently createGroup() preserves the casing of the name and addGroup() will lowercase the name. Both methods were in use by Confluence, but only one overwritten to publish an event.

Specified by:
createGroup in interface UserAccessor
Overrides:
createGroup in class DefaultUserAccessor

removeGroup

public void removeGroup(com.atlassian.user.Group group)
Description copied from interface: UserAccessor
Removes the specified group. Does nothing if the group does not exist.

Specified by:
removeGroup in interface UserAccessor
Overrides:
removeGroup in class DefaultUserAccessor
Throws:
InsufficientPrivilegeException - if you do not have sufficient permissions to remove this group. Check permissions using Permission.REMOVE and PermissionManager on the group first.

removeUser

public void removeUser(com.atlassian.user.User user)
Removes the specified user.

Specified by:
removeUser in interface UserAccessor
Overrides:
removeUser in class DefaultUserAccessor
Throws:
java.lang.IllegalArgumentException - if the specified user is null
InsufficientPrivilegeException - if the currently logged in user does not permissions to remove this user. Check permissions using Permission.REMOVE and PermissionManager on the user first.

getUserNamesWithConfluenceAccess

public java.util.List<java.lang.String> getUserNamesWithConfluenceAccess()
Description copied from interface: UserAccessor
Returns the names of all users with access to use Confluence. If you only need to know the number of users, you should call UserChecker.getNumberOfRegisteredUsers(), as that caches its results.

See Also:
UserChecker

countUsersWithConfluenceAccess

public int countUsersWithConfluenceAccess()
See Also:
UserChecker

countLicenseConsumingUsers

public int countLicenseConsumingUsers()
Description copied from interface: UserAccessor
Returns the number of users which have access to use Confluence AND consume a Confluence license. Callers are strongly recommended to use the UserChecker.getNumberOfRegisteredUsers() to retrieve this info, as that caches its results.

See Also:
UserChecker

getUsersWithConfluenceAccess

public com.atlassian.user.search.page.Pager<com.atlassian.user.User> getUsersWithConfluenceAccess()
Returns all the users with access to use Confluence.

Specified by:
getUsersWithConfluenceAccess in interface UserAccessor

isDeactivated

public boolean isDeactivated(java.lang.String username)
Description copied from interface: UserAccessor
Returns true if the user with the specified username exists and is unable to log in, otherwise false. Returns false if the username is null.

Specified by:
isDeactivated in interface UserAccessor
Returns:
true if the user with the specified username exists and is unable to log in, otherwise false.

isDeactivated

public boolean isDeactivated(com.atlassian.user.User user)
Description copied from interface: UserAccessor
Returns true if the user exists and is unable to log in, otherwise false. Returns false if the user is null.

Specified by:
isDeactivated in interface UserAccessor
Returns:
true if the user exists and is unable to log in, otherwise false.

savePersonalInformation

public void savePersonalInformation(PersonalInformation newInfo,
                                    PersonalInformation oldInfo)

deactivateUser

public void deactivateUser(com.atlassian.user.User user)
Description copied from interface: UserAccessor
Deactivate the specified user, which prevents them logging in. Does nothing if the user is already deactivated.

Specified by:
deactivateUser in interface UserAccessor

reactivateUser

public void reactivateUser(com.atlassian.user.User user)
Description copied from interface: UserAccessor
Marks the specified user as active, which allows them to log in. Does nothing if the user is already active.

Specified by:
reactivateUser in interface UserAccessor

isReadOnly

public boolean isReadOnly(com.atlassian.user.User user)
Description copied from interface: UserAccessor
Returns true if the user cannot be modified or removed. However, returning false does necessarily confirm that the user can be modified or removed. Depending on the user management configuration, it is not always possible for Confluence to determine whether a user is read-only.

In an internal-only user management configuration, this method always returns false.


isReadOnly

public boolean isReadOnly(com.atlassian.user.Group group)
Description copied from interface: UserAccessor
Returns true if the group cannot be modified or removed. However, returning false does necessarily confirm that the group can be modified or removed. Depending on the user management configuration, it is not always possible for Confluence to determine whether a group is read-only. Indeed, groups can span across multiple directories with different access control mechanisms, so it may be possible to modify certain memberships of a group but not others.

In an internal-only user management configuration, this method always returns false.


filterUnaccessibleUsers

@Deprecated
public com.atlassian.user.search.page.Pager<com.atlassian.user.User> filterUnaccessibleUsers(com.atlassian.user.search.page.Pager<com.atlassian.user.User> userPager,
                                                                                                        com.atlassian.user.User user)
Deprecated. Since 5.1. This method no longer does anything, and returns the same list of users as was passed in.


filterUnaccessibleGroups

@Deprecated
public com.atlassian.user.search.page.Pager<com.atlassian.user.Group> filterUnaccessibleGroups(com.atlassian.user.search.page.Pager<com.atlassian.user.Group> groupPager,
                                                                                                          com.atlassian.user.User user)
Deprecated. Since 5.1. This method no longer does anything, and returns the same list of users as was passed in.


getUserProfilePicture

public ProfilePictureInfo getUserProfilePicture(java.lang.String username)
Description copied from interface: UserAccessor
Retrieve the path to a user's personal picture

Parameters:
username - the user whose picture to look up.
Returns:
The path to a user's personal picture, or null if they don't have one set.

getLogoForUser

public ProfilePictureInfo getLogoForUser(com.atlassian.user.User user)

getUserProfilePicture

public ProfilePictureInfo getUserProfilePicture(com.atlassian.user.User user)
Description copied from interface: UserAccessor
Retrieve the path to a user's personal picture

Parameters:
user - the user whose picture to look up.
Returns:
The path to a user's personal picture, or null if they don't have one set.

setUserProfilePicture

public void setUserProfilePicture(com.atlassian.user.User user,
                                  Attachment attachment)
Description copied from interface: UserAccessor
Set the user profile picture to the given attachment. The attachment should be an image attached to that user's personal information, of size 48x48. No check is performed in this method that the image is valid or the right size.

Parameters:
user - the user to set a profile picture for
attachment - the attachment containing the user's profile picture

setUserProfilePicture

public void setUserProfilePicture(com.atlassian.user.User user,
                                  java.lang.String imagePath)
Description copied from interface: UserAccessor
Set the user profile picture to a built-in image. The path should be the web-application-root-relative path to the image to be used as the user's profile picture and should be size 48x48. Neither are checked by the implementation

Parameters:
user - the user to set a profile picture for
imagePath - the image path to that picture.

getAllDefaultGroupNames

@Deprecated
public java.util.List<java.lang.String> getAllDefaultGroupNames()
Deprecated. Since 5.2. This method is vague and returns a collection containing the result of Settings.getDefaultUsersGroup() and UserAccessor.GROUP_CONFLUENCE_ADMINS. Clients should explicitly decide what they need and use that.

Description copied from interface: UserAccessor
Get the list of default group names.

Returns:
a list with the default group names.

getNewUserDefaultGroupName

@Deprecated
public java.lang.String getNewUserDefaultGroupName()
Deprecated. since 5.2. Use Settings.getDefaultUsersGroup() via SettingsManager.getGlobalSettings().

Get the name of the default group for a new user.

Returns:
the default group for a new user.

isSuperUser

public boolean isSuperUser(com.atlassian.user.User user)
Description copied from interface: UserAccessor
Return true if the user is an all-powerful super-user (member of the confluence-administrators group).

Parameters:
user - the user to check for (the null user will always return false
Returns:
true if the user is a super-user, false otherwise.

getConfluenceUserPreferences

public ConfluenceUserPreferences getConfluenceUserPreferences(com.atlassian.user.User user)

filterUnaccessibleUsers

@Deprecated
public java.util.List<com.atlassian.user.User> filterUnaccessibleUsers(java.util.List<com.atlassian.user.User> users,
                                                                                  com.atlassian.user.User user)
Deprecated. Since 5.1. This method no longer does anything, and returns the same list of users as was passed in.


filterUnaccessibleGroups

@Deprecated
public java.util.List<com.atlassian.user.Group> filterUnaccessibleGroups(java.util.List<com.atlassian.user.Group> groupList,
                                                                                    com.atlassian.user.User user)
Deprecated. Since 5.1. This method no longer does anything, and returns the same list of groups as was passed in.


getGroupNames

public java.util.List<java.lang.String> getGroupNames(com.atlassian.user.User user)
Description copied from interface: UserAccessor
Gets the list of group names representing the groups the passed in user is a member of.

Parameters:
user - the user to perform the membership check for
Returns:
a list of group names

getGroupNamesForUserName

public java.util.List<java.lang.String> getGroupNamesForUserName(java.lang.String userName)
Description copied from interface: UserAccessor
Gets the list of group names representing the groups the passed in user is a member of.

Parameters:
userName - the name of the user to perform the membership check for
Returns:
a list of group names

getGroupsAsList

public java.util.List<com.atlassian.user.Group> getGroupsAsList()

getMemberNamesAsList

public java.util.List<java.lang.String> getMemberNamesAsList(com.atlassian.user.Group group)
Description copied from interface: UserAccessor
Same as UserAccessor.getMemberNames(com.atlassian.user.Group) but returns a List of user names as Strings rather than a Pager.

Parameters:
group - to retrieve the member names from
Returns:
a list of Strings

getMembers

public java.lang.Iterable<ConfluenceUser> getMembers(com.atlassian.user.Group group)
Description copied from interface: UserAccessor
Returns users who are members of the specified group (either directly or as a member of a nested group). Returns an empty iterable if the group is null or the group doesn't exist.

Elements are generated on demand and it is recommended to fetch only as many elements as are needed.

Parameters:
group - group to get members for
Returns:
users who are members of the specified group

getWriteableGroups

public java.util.List<com.atlassian.user.Group> getWriteableGroups()
Description copied from interface: UserAccessor
Gets all editable groups. That is, returns any groups that belong to read/write repositories. Groups in readonly repositories that are ReadOnly are not returned.

Returns:
list of Groups that can be edited.

getPropertySet

public com.opensymphony.module.propertyset.PropertySet getPropertySet(ConfluenceUser user)
Returns:
the property set for the supplied user

getUsersWithConfluenceAccessAsList

public java.util.List<com.atlassian.user.User> getUsersWithConfluenceAccessAsList()
Returns all the users which have access to use Confluence.

See Also:
UserAccessor.countUsersWithConfluenceAccess()

getUserIfAvailable

@Deprecated
public com.atlassian.user.User getUserIfAvailable(java.lang.String username)
Deprecated. since 5.2

See Also:
getUserByName(String)

getGroupsAsList

public java.util.List<com.atlassian.user.Group> getGroupsAsList(com.atlassian.user.User user)

findUsersAsList

public java.util.List<com.atlassian.user.User> findUsersAsList(com.atlassian.user.search.query.Query<com.atlassian.user.User> search)
                                                        throws com.atlassian.user.EntityException
Throws:
com.atlassian.user.EntityException

renameUser

public ConfluenceUser renameUser(ConfluenceUser user,
                                 java.lang.String newUsername)
                          throws com.atlassian.user.EntityException
Description copied from interface: UserAccessor
Updates the username of the given user.

Parameters:
user - user to rename
newUsername - username to use for renaming
Returns:
renamed user
Throws:
com.atlassian.user.impl.EntityValidationException - if the new username does not meet the username requirements
com.atlassian.user.EntityException - if the operation is not allowed for the user
com.atlassian.user.impl.DuplicateEntityException - if the username is already taken


Copyright © 2003-2014 Atlassian. All Rights Reserved.