Class ReadOnlyUserAccessor
- All Implemented Interfaces:
UserAccessor,UserAccessorInternal,ConfluenceUserResolver,GroupMembershipAccessor,GroupResolver,UserAccessor,UserExistenceChecker,UserPreferencesAccessor,UserProfilePictureAccessor,com.atlassian.user.search.query.EntityQueryParser
- Since:
- 8.8
-
Field Summary
Fields inherited from interface com.atlassian.confluence.user.UserAccessor
DEFAULT_GROUP_NAMES, GROUP_CONFLUENCE_ADMINS, GROUP_CONFLUENCE_USERS, PROFILE_PICTURE_BUILTIN_PATH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.atlassian.user.GroupCreates a group with the specified name and returns it.voidaddMembership(com.atlassian.user.Group group, com.atlassian.user.User user) voidaddMembership(String groupname, String username) com.atlassian.user.Usercom.atlassian.user.UservoidalterPassword(com.atlassian.user.User user, String plainTextPassword) voidalterPassword(com.atlassian.user.User user, String plainTextPassword, String token) booleanauthenticate(String username, String password) intReturns the number of users which have access to use Confluence AND consume a Confluence license.intGet a count of all unsynced users in Confluence.com.atlassian.user.GroupcreateGroup(String groupname) @Nullable ConfluenceUsercreateUser(com.atlassian.crowd.model.user.UserTemplateWithAttributes userTemplate, com.atlassian.user.security.password.Credential password) Creates a user from the given template, with the given password.createUser(com.atlassian.user.User userTemplate, com.atlassian.user.security.password.Credential password) voiddeactivateUser(com.atlassian.user.User user) Deactivate the specified user, which prevents them logging in.voiddeactivateUserLocally(com.atlassian.user.User user) Deactivate the specified user, which prevents them logging in.booleanReturns true if a user exists with the given username.com.atlassian.user.search.SearchResult<com.atlassian.user.Group>findGroups(com.atlassian.user.search.query.Query<com.atlassian.user.Group> query) com.atlassian.user.search.SearchResult<com.atlassian.user.Group>findGroups(com.atlassian.user.search.query.Query<com.atlassian.user.Group> query, com.atlassian.user.search.query.QueryContext context) com.atlassian.user.search.SearchResult<com.atlassian.user.User>findUsers(com.atlassian.user.search.query.Query<com.atlassian.user.User> search) com.atlassian.user.search.SearchResult<com.atlassian.user.User>findUsers(com.atlassian.user.search.query.Query<com.atlassian.user.User> query, com.atlassian.user.search.query.QueryContext context) List<com.atlassian.user.User>findUsersAsList(com.atlassian.user.search.query.Query<com.atlassian.user.User> search) Get the list of default group names.@NonNull ConfluenceUserPreferencesgetConfluenceUserPreferences(@Nullable com.atlassian.user.User user) Deprecated, for removal: This API element is subject to removal in a future version.getExistingByApiUser(User user) Retrieve the corresponding ConfluenceUser (if any) for a user, by user key or username@Nullable ConfluenceUsergetExistingUserByKey(com.atlassian.sal.api.user.UserKey key) Returns the user with the specified user key, ornullif the user doesn't exist or the key isnull.@Nullable ConfluenceUsergetExistingUserByPerson(Person person) Retrieve the corresponding ConfluenceUser (if any) for a Person, by username, or user keycom.atlassian.user.GroupReturns the group with the specified name, ornullif the user doesn't exist or the name isnull.com.atlassian.user.GroupgetGroupNames(com.atlassian.user.User user) Gets the list of group names representing the groups the passed in user is a member of.getGroupNamesForUserName(String userName) Gets the list of group names representing the groups the passed in user is a member of.com.atlassian.user.search.page.Pager<com.atlassian.user.Group>Returns a pager of all groups in the system.com.atlassian.user.search.page.Pager<com.atlassian.user.Group>getGroups(com.atlassian.user.User user) List<com.atlassian.user.Group>List<com.atlassian.user.Group>getGroupsByGroupNames(List<String> groupNames) Returns a list of Group objects where the names match that of the provided list of group names.com.atlassian.user.search.page.Pager<String>getMemberNames(com.atlassian.user.Group group) Returns a pager containing the usernames of users who are members of the specified group (either directly or as a member of a nested group).getMemberNamesAsList(com.atlassian.user.Group group) Same asUserAccessor.getMemberNames(com.atlassian.user.Group)but returns a List of user names asStrings rather than a Pager.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).getMembers(com.atlassian.user.Group group, int limit) Returns users who are members of the specified group.Get the name of the default group for a new user.com.opensymphony.module.propertyset.PropertySetgetPropertySet(ConfluenceUser user) Deprecated, for removal: This API element is subject to removal in a future version.com.opensymphony.module.propertyset.PropertySetgetPropertySet(com.atlassian.user.User user) Deprecated, for removal: This API element is subject to removal in a future version.com.atlassian.user.UserReturns the user with the specified name, ornullif the user doesn't exist or the name isnull.@Nullable ConfluenceUsergetUserByKey(com.atlassian.sal.api.user.UserKey key) Returns the user with the specified user key, ornullif the user has never existed or the key isnull.@Nullable ConfluenceUsergetUserByName(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.search.page.Pager<String>Returns a pager of all usernames in the system.Returns the names of all users with access to use Confluence.getUserPreferences(com.atlassian.user.User user) Deprecated, for removal: This API element is subject to removal in a future version.getUserProfilePicture(@Nullable com.atlassian.user.User user) Retrieve the path to a user's personal picturecom.atlassian.user.search.page.Pager<com.atlassian.user.User>getUsers()Returns a pager of all users in the system.@NonNull PageResponse<ConfluenceUser>getUsers(LimitedRequest limitedRequest) Get fully backed (active or disabled) Confluence Users.com.atlassian.user.search.SearchResultgetUsersByEmail(String email) getUsersByUserKeys(List<com.atlassian.sal.api.user.UserKey> userKeys) Returns a list of ConfluenceUser with the supplied UserKeys or an empty list if the users do not exist.List<com.atlassian.user.Group>Gets all editable groups.booleanhasMembership(com.atlassian.user.Group group, com.atlassian.user.User user) Returnstrueif the specified user and group both exist, and the user is a member of the group (either directly or as a member of a nested group).booleanhasMembership(String groupName, String username) Returnstrueif the specified user and group both exist, and the user is a member of the group (either directly or as a member of a nested group).booleanisCrowdManaged(ConfluenceUser user) Checks whether or not embedded Crowd manages/has knowledge of a given userbooleanisDeactivated(com.atlassian.user.User user) Returns true if the user exists and is unable to log in, otherwise false.booleanisDeactivated(String username) Returns true if the user with the specified username exists and is unable to log in, otherwise false.booleanisDeletedUser(ConfluenceUser user) Checks whether or not a user has been deleted from the applicationbooleanbooleanisReadOnly(com.atlassian.user.Group group) Returnstrueif the group cannot be modified or removed.booleanisReadOnly(com.atlassian.user.User user) Returnstrueif the user cannot be modified or removed.booleanisSuperUser(com.atlassian.user.User user) Return true is the user is a super user.booleanisUnsyncedUser(ConfluenceUser user) Checks whether or not a user is unsyncedbooleanisUserRemovable(com.atlassian.user.User user) voidreactivateUser(com.atlassian.user.User user) Marks the specified user as active, which allows them to log in.voidreactivateUserLocally(com.atlassian.user.User user) Marks the specified user as active, which allows them to log in.voidremoveGroup(com.atlassian.user.Group group) Removes the specified group.booleanremoveMembership(com.atlassian.user.Group group, com.atlassian.user.User user) booleanremoveMembership(String groupname, String username) voidremoveUser(com.atlassian.user.User user) Removes the specified user.renameUser(ConfluenceUser user, String newUsername) Updates the username of the given user.voidsaveUser(com.atlassian.user.User user) Persists changes made to a user (e.g.com.atlassian.user.search.page.Pager<ConfluenceUser>searchUnsyncedUsers(String searchParam) Returns a list of all users for the given username search parameter that are unsynced: a user whose account has been disconnected from an external directory, i.e.voidsetUserProfilePicture(com.atlassian.user.User user, Attachment attachment) Set the user profile picture to the given attachment.voidsetUserProfilePicture(com.atlassian.user.User targetUser, String imagePath) Set the user profile picture to a built-in image.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.confluence.user.UserPreferencesAccessor
getUserPreferences
-
Constructor Details
-
ReadOnlyUserAccessor
-
-
Method Details
-
addUser
public com.atlassian.user.User addUser(String username, String password, String email, String fullname, String[] groups) - Specified by:
addUserin interfaceUserAccessor
-
addUser
public com.atlassian.user.User addUser(String username, String password, String email, String fullname) - Specified by:
addUserin interfaceUserAccessor
-
getUserNames
Description copied from interface:UserAccessorReturns a pager of all usernames in the system. Clients should not normally use this method, but perform a search usingUserAccessor.findUsers(Query)or the CrowdService API instead.- Specified by:
getUserNamesin interfaceUserAccessor
-
getUsers
public com.atlassian.user.search.page.Pager<com.atlassian.user.User> getUsers()Description copied from interface:UserAccessorReturns a pager of all users in the system. Clients should not normally use this method, but perform a search usingUserAccessor.findUsers(Query)or the CrowdService API instead.- Specified by:
getUsersin interfaceUserAccessor
-
getGroup
Description copied from interface:UserAccessorReturns the group with the specified name, ornullif the user doesn't exist or the name isnull.- Specified by:
getGroupin interfaceGroupResolver- Specified by:
getGroupin interfaceUserAccessor
-
getGroups
public com.atlassian.user.search.page.Pager<com.atlassian.user.Group> getGroups()Description copied from interface:UserAccessorReturns a pager of all groups in the system. Clients should not normally use this method, but perform a search usingEntityQueryParser.findGroups(Query)or the CrowdService API instead.- Specified by:
getGroupsin interfaceUserAccessor
-
addGroup
Description copied from interface:UserAccessorCreates a group with the specified name and returns it.- Specified by:
addGroupin interfaceUserAccessor
-
removeGroup
public void removeGroup(com.atlassian.user.Group group) Description copied from interface:UserAccessorRemoves the specified group. Does nothing if the group does not exist.- Specified by:
removeGroupin interfaceUserAccessor
-
removeUser
public void removeUser(com.atlassian.user.User user) throws com.atlassian.core.exception.InfrastructureException Description copied from interface:UserAccessorRemoves the specified user. Does nothing if the user does not exist.- Specified by:
removeUserin interfaceUserAccessor- Throws:
com.atlassian.core.exception.InfrastructureException- if the user could not be removed
-
getGroupCreateIfNecessary
- Specified by:
getGroupCreateIfNecessaryin interfaceUserAccessor
-
getUserPreferences
@Deprecated(forRemoval=true) public UserPreferences getUserPreferences(com.atlassian.user.User user) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getUserPreferencesin interfaceUserAccessor
-
saveUser
public void saveUser(com.atlassian.user.User user) Description copied from interface:UserAccessorPersists changes made to a user (e.g. changing email or full name).- Specified by:
saveUserin interfaceUserAccessor
-
getUsersByEmail
- Specified by:
getUsersByEmailin interfaceUserAccessor
-
deactivateUser
public void deactivateUser(com.atlassian.user.User user) Description copied from interface:UserAccessorDeactivate the specified user, which prevents them logging in. Does nothing if the user is already deactivated.- Specified by:
deactivateUserin interfaceUserAccessor
-
deactivateUserLocally
public void deactivateUserLocally(com.atlassian.user.User user) Description copied from interface:UserAccessorDeactivate the specified user, which prevents them logging in. Does nothing if the user is already deactivated. This only deactivates the user from local confluence db, even if the user is coming from remote directory- Specified by:
deactivateUserLocallyin interfaceUserAccessor- Parameters:
user- theUserto be deactivated
-
reactivateUserLocally
public void reactivateUserLocally(com.atlassian.user.User user) Description copied from interface:UserAccessorMarks the specified user as active, which allows them to log in. Does nothing if the user is already active. This only activates the user from local confluence db, even if the user is coming from remote directory- Specified by:
reactivateUserLocallyin interfaceUserAccessor- Parameters:
user- theUserto be reactivated
-
reactivateUser
public void reactivateUser(com.atlassian.user.User user) Description copied from interface:UserAccessorMarks the specified user as active, which allows them to log in. Does nothing if the user is already active.- Specified by:
reactivateUserin interfaceUserAccessor
-
isUserRemovable
public boolean isUserRemovable(com.atlassian.user.User user) throws com.atlassian.user.EntityException - Specified by:
isUserRemovablein interfaceUserAccessor- Throws:
com.atlassian.user.EntityException
-
getGroups
public com.atlassian.user.search.page.Pager<com.atlassian.user.Group> getGroups(com.atlassian.user.User user) - Specified by:
getGroupsin interfaceUserAccessor
-
hasMembership
public boolean hasMembership(com.atlassian.user.Group group, com.atlassian.user.User user) Description copied from interface:UserAccessorReturnstrueif the specified user and group both exist, and the user is a member of the group (either directly or as a member of a nested group). In all other circumstances, returnsfalse.- Specified by:
hasMembershipin interfaceUserAccessor
-
hasMembership
Description copied from interface:UserAccessorReturnstrueif the specified user and group both exist, and the user is a member of the group (either directly or as a member of a nested group). In all other circumstances, returnsfalse.- Specified by:
hasMembershipin interfaceUserAccessor
-
addMembership
public void addMembership(com.atlassian.user.Group group, com.atlassian.user.User user) - Specified by:
addMembershipin interfaceUserAccessor
-
addMembership
- Specified by:
addMembershipin interfaceUserAccessor
-
removeMembership
public boolean removeMembership(com.atlassian.user.Group group, com.atlassian.user.User user) - Specified by:
removeMembershipin interfaceUserAccessor
-
getMemberNames
Description copied from interface:UserAccessorReturns a pager containing the usernames of users who are members of the specified group (either directly or as a member of a nested group). Returns an empty pager if the group has no members or doesn't exist.- Specified by:
getMemberNamesin interfaceGroupMembershipAccessor- Specified by:
getMemberNamesin interfaceUserAccessor
-
createGroup
- Specified by:
createGroupin interfaceUserAccessor
-
authenticate
- Specified by:
authenticatein interfaceUserAccessor
-
findUsers
public com.atlassian.user.search.SearchResult<com.atlassian.user.User> findUsers(com.atlassian.user.search.query.Query<com.atlassian.user.User> search) throws com.atlassian.user.EntityException - Specified by:
findUsersin interfacecom.atlassian.user.search.query.EntityQueryParser- Specified by:
findUsersin interfaceUserAccessor- Throws:
com.atlassian.user.EntityException
-
findGroups
public com.atlassian.user.search.SearchResult<com.atlassian.user.Group> findGroups(com.atlassian.user.search.query.Query<com.atlassian.user.Group> query) throws com.atlassian.user.EntityException - Specified by:
findGroupsin interfacecom.atlassian.user.search.query.EntityQueryParser- Throws:
com.atlassian.user.EntityException
-
findUsers
public com.atlassian.user.search.SearchResult<com.atlassian.user.User> findUsers(com.atlassian.user.search.query.Query<com.atlassian.user.User> query, com.atlassian.user.search.query.QueryContext context) throws com.atlassian.user.EntityException - Specified by:
findUsersin interfacecom.atlassian.user.search.query.EntityQueryParser- Throws:
com.atlassian.user.EntityException
-
findGroups
public com.atlassian.user.search.SearchResult<com.atlassian.user.Group> findGroups(com.atlassian.user.search.query.Query<com.atlassian.user.Group> query, com.atlassian.user.search.query.QueryContext context) throws com.atlassian.user.EntityException - Specified by:
findGroupsin interfacecom.atlassian.user.search.query.EntityQueryParser- Throws:
com.atlassian.user.EntityException
-
alterPassword
public void alterPassword(com.atlassian.user.User user, String plainTextPassword) throws com.atlassian.user.EntityException - Specified by:
alterPasswordin interfaceUserAccessor- Throws:
com.atlassian.user.EntityException
-
removeMembership
- Specified by:
removeMembershipin interfaceUserAccessor
-
getUsers
Description copied from interface:ConfluenceUserResolverGet fully backed (active or disabled) Confluence Users. When both embedded Crowd tables and Confluence user tables have the same user, that user can be retrieved.This means, when embedded crowd has the user, but Confluence does not (unsynced, externally deleted, shadowed), the user is not retrievable.
This means, when embedded crowd has a user, but Confluence does not, the user is not retrievable.- Specified by:
getUsersin interfaceConfluenceUserResolver- Parameters:
limitedRequest- the limited request for ConfluenceUser- Returns:
- a non-null page response of ConfluenceUser.
-
getExistingUserByPerson
Description copied from interface:UserAccessorInternalRetrieve the corresponding ConfluenceUser (if any) for a Person, by username, or user key- Specified by:
getExistingUserByPersonin interfaceConfluenceUserResolver- Specified by:
getExistingUserByPersonin interfaceUserAccessorInternal- Parameters:
person- the person whose corresponding ConfluenceUser should be retrieved- Returns:
- Person as a confluence user, or null if user doesn't exist or if person is Anonymous
-
getExistingByApiUser
Description copied from interface:UserAccessorInternalRetrieve the corresponding ConfluenceUser (if any) for a user, by user key or usernameOne of username or userkey must be set on the user object.
This method differs from
UserAccessorInternal.getExistingUserByPerson(com.atlassian.confluence.api.model.people.Person)in its handling of anonymous, it is not possible to retrieve an anonymous user from this method. When a Option.none() is returned from this method it indicates that the user was not found in the user repository.- Specified by:
getExistingByApiUserin interfaceConfluenceUserResolver- Specified by:
getExistingByApiUserin interfaceUserAccessorInternal- Parameters:
user- the user whose corresponding ConfluenceUser should be retrieved- Returns:
- an optional confluence user if the user is found by userkey or username
-
isDeletedUser
Description copied from interface:UserAccessorInternalChecks whether or not a user has been deleted from the application- Specified by:
isDeletedUserin interfaceUserAccessorInternal- Parameters:
user- the user to check- Returns:
- true if the user has been deleted from the application, false otherwise (even if the user doesn't exist)
-
isUnsyncedUser
Description copied from interface:UserAccessorInternalChecks whether or not a user is unsynced- Specified by:
isUnsyncedUserin interfaceUserAccessorInternal- Parameters:
user- the user to check- Returns:
- true if the user is unsynced, false otherwise (even if the user doesn't exist)
-
isCrowdManaged
Description copied from interface:UserAccessorInternalChecks whether or not embedded Crowd manages/has knowledge of a given user- Specified by:
isCrowdManagedin interfaceUserAccessorInternal- Returns:
- true if the user is managed by embedded Crowd, false otherwise (even if the user doesn't exist)
-
searchUnsyncedUsers
Description copied from interface:UserAccessorInternalReturns a list of all users for the given username search parameter that are unsynced: a user whose account has been disconnected from an external directory, i.e. a user who has a known mapping but no backing user, but who has not yet been deleted from the application.- Specified by:
searchUnsyncedUsersin interfaceUserAccessorInternal- Parameters:
searchParam- the username parameter to search by- Returns:
- a pager of all unknown / unsynced users
-
createUser
public @Nullable ConfluenceUser createUser(com.atlassian.crowd.model.user.UserTemplateWithAttributes userTemplate, com.atlassian.user.security.password.Credential password) Description copied from interface:UserAccessorInternalCreates a user from the given template, with the given password.- Specified by:
createUserin interfaceUserAccessorInternal- Parameters:
userTemplate- the user template to create a user withpassword- the password to set, orCredential.NONEto set a random password- Returns:
- the created user, if they are the canonical user for the given username. Can be null
-
getUser
Description copied from interface:UserAccessorReturns the user with the specified name, ornullif the user doesn't exist or the name isnull. Note that use rname lookups are case-insensitive, so the user you get back may not have exactly the same name as the name passed to this method.- Specified by:
getUserin interfaceUserAccessor- Specified by:
getUserin interfaceUserAccessor- Parameters:
name- the user name of the user- Returns:
- the User with the supplied user name or null.
-
getUserByName
Description copied from interface:UserAccessorReturns 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.
- Specified by:
getUserByNamein interfaceConfluenceUserResolver- Specified by:
getUserByNamein interfaceUserAccessor- Parameters:
name- the user name of the user- Returns:
- the ConfluenceUser with the supplied user name or null.
-
getUserByKey
Description copied from interface:UserAccessorReturns the user with the specified user key, ornullif the user has never existed or the key isnull.WARNING: This method can return deleted users. Use
UserAccessor.getExistingUserByKey(com.atlassian.sal.api.user.UserKey)to get only users that exist.- Specified by:
getUserByKeyin interfaceConfluenceUserResolver- Specified by:
getUserByKeyin interfaceUserAccessor
-
getExistingUserByKey
Description copied from interface:UserAccessorReturns the user with the specified user key, ornullif the user doesn't exist or the key isnull.- Specified by:
getExistingUserByKeyin interfaceConfluenceUserResolver- Specified by:
getExistingUserByKeyin interfaceUserAccessor
-
exists
Description copied from interface:UserAccessorReturns true if a user exists with the given username. This method is significantly faster thangetUser(name) != null.- Specified by:
existsin interfaceUserAccessor- Specified by:
existsin interfaceUserExistenceChecker- 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 password) Description copied from interface:UserAccessor- Specified by:
createUserin interfaceUserAccessor- Specified by:
createUserin interfaceUserAccessor
-
isReadOnly
public boolean isReadOnly(com.atlassian.user.User user) Description copied from interface:UserAccessorReturnstrueif the user cannot be modified or removed. However, returningfalsedoes 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.- Specified by:
isReadOnlyin interfaceUserAccessor
-
isReadOnly
public boolean isReadOnly(com.atlassian.user.Group group) Description copied from interface:UserAccessorReturnstrueif the group cannot be modified or removed. However, returningfalsedoes 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.- Specified by:
isReadOnlyin interfaceUserAccessor
-
getUserProfilePicture
Description copied from interface:UserAccessorRetrieve the path to a user's personal picture- Specified by:
getUserProfilePicturein interfaceUserAccessor- Specified by:
getUserProfilePicturein interfaceUserProfilePictureAccessor- 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.
-
getConfluenceUserPreferences
@Deprecated(forRemoval=true) public @NonNull ConfluenceUserPreferences getConfluenceUserPreferences(@Nullable com.atlassian.user.User user) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getConfluenceUserPreferencesin interfaceUserAccessor- Specified by:
getConfluenceUserPreferencesin interfaceUserPreferencesAccessor
-
isSuperUser
public boolean isSuperUser(com.atlassian.user.User user) Description copied from interface:UserAccessorReturn true is the user is a super user. This should not be used to infer any special permission exempt behaviours. In general, relying on group memberships for special behaviour is a bad idea. Permission checks in the application likePermissionManager.hasPermission(User, Permission, Object)already take care of super-user permission exempt checks and more. If checking for exemption from any permission checks is still required explicitly, usePermissionManager.isConfluenceAdministrator(User)instead. It also takes care of more checks than a group-membership for permission exemption. e.g. Checking exemptions before applying permission related query and/or filter, seeAlphabeticalListPagesAction.getFilter(ConfluenceUser)- Specified by:
isSuperUserin interfaceUserAccessor- Parameters:
user- the user to check for (the null user will always return false)- Returns:
- true if the user is super-user, false otherwise.
-
getGroupsAsList
- Specified by:
getGroupsAsListin interfaceUserAccessor
-
getMemberNamesAsList
Description copied from interface:UserAccessorSame asUserAccessor.getMemberNames(com.atlassian.user.Group)but returns a List of user names asStrings rather than a Pager.- Specified by:
getMemberNamesAsListin interfaceGroupMembershipAccessor- Specified by:
getMemberNamesAsListin interfaceUserAccessor- Parameters:
group- to retrieve the member names from- Returns:
- a list of
Strings
-
getMembers
Description copied from interface:UserAccessorReturns 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.
- Specified by:
getMembersin interfaceUserAccessor- Parameters:
group- group to get members for- Returns:
- users who are members of the specified group
-
getMembers
Description copied from interface:UserAccessorReturns users who are members of the specified group. This API will only return users upto the given limit (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.
- Specified by:
getMembersin interfaceUserAccessor- Parameters:
group- group to get members forlimit- maximum number of users to return- Returns:
- users who are members of the specified group
-
getGroupNames
Description copied from interface:UserAccessorGets the list of group names representing the groups the passed in user is a member of.- Specified by:
getGroupNamesin interfaceUserAccessor- Parameters:
user- the user to perform the membership check for- Returns:
- a list of group names
-
getGroupNamesForUserName
Description copied from interface:UserAccessorGets the list of group names representing the groups the passed in user is a member of.- Specified by:
getGroupNamesForUserNamein interfaceUserAccessor- Parameters:
userName- the name of the user to perform the membership check for- Returns:
- a list of group names
-
getWriteableGroups
Description copied from interface:UserAccessorGets all editable groups. That is, returns any groups that belong to read/write repositories. Groups in readonly repositories that are ReadOnly are not returned.- Specified by:
getWriteableGroupsin interfaceUserAccessor- Returns:
- list of
Groups that can be edited.
-
getPropertySet
@Deprecated(forRemoval=true) public com.opensymphony.module.propertyset.PropertySet getPropertySet(com.atlassian.user.User user) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getPropertySetin interfaceUserAccessor- Specified by:
getPropertySetin interfaceUserAccessor
-
getPropertySet
@Deprecated(forRemoval=true) public com.opensymphony.module.propertyset.PropertySet getPropertySet(ConfluenceUser user) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getPropertySetin interfaceUserAccessor- Returns:
- the property set for the supplied user
-
getUserNamesWithConfluenceAccess
Description copied from interface:UserAccessorReturns the names of all users with access to use Confluence. If you only need to know the number of users, you should callUserChecker.getNumberOfRegisteredUsers(), as that caches its results.- Specified by:
getUserNamesWithConfluenceAccessin interfaceUserAccessor- See Also:
-
countLicenseConsumingUsers
public int countLicenseConsumingUsers()Description copied from interface:UserAccessorReturns the number of users which have access to use Confluence AND consume a Confluence license. Callers are strongly recommended to use theUserChecker.getNumberOfRegisteredUsers()to retrieve this info, as that caches its results.- Specified by:
countLicenseConsumingUsersin interfaceUserAccessor- See Also:
-
findUsersAsList
public List<com.atlassian.user.User> findUsersAsList(com.atlassian.user.search.query.Query<com.atlassian.user.User> search) throws com.atlassian.user.EntityException - Specified by:
findUsersAsListin interfaceUserAccessor- Throws:
com.atlassian.user.EntityException
-
setUserProfilePicture
Description copied from interface:UserAccessorSet 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.- Specified by:
setUserProfilePicturein interfaceUserAccessor- Parameters:
user- the user to set a profile picture forattachment- the attachment containing the user's profile picture
-
setUserProfilePicture
Description copied from interface:UserAccessorSet 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- Specified by:
setUserProfilePicturein interfaceUserAccessor- Parameters:
targetUser- the user to set a profile picture forimagePath- the image path to that picture.
-
getAllDefaultGroupNames
Description copied from interface:UserAccessorGet the list of default group names.- Specified by:
getAllDefaultGroupNamesin interfaceUserAccessor- Returns:
- a list with the default group names.
-
getNewUserDefaultGroupName
Description copied from interface:UserAccessorGet the name of the default group for a new user.- Specified by:
getNewUserDefaultGroupNamein interfaceUserAccessor- Returns:
- the default group for a new user.
-
renameUser
public ConfluenceUser renameUser(ConfluenceUser user, String newUsername) throws com.atlassian.user.EntityException Description copied from interface:UserAccessorUpdates the username of the given user.- Specified by:
renameUserin interfaceUserAccessor- Parameters:
user- user to renamenewUsername- username to use for renaming- Returns:
- renamed user
- Throws:
com.atlassian.user.impl.EntityValidationException- if the new username does not meet the username requirementscom.atlassian.user.EntityException- if the operation is not allowed for the usercom.atlassian.user.impl.DuplicateEntityException- if the username is already taken
-
getUsersByUserKeys
Description copied from interface:UserAccessorReturns a list of ConfluenceUser with the supplied UserKeys or an empty list if the users do not exist. This method returns ConfluenceUser instances with pre-populated backing EmbeddedCrowdUser.- Specified by:
getUsersByUserKeysin interfaceConfluenceUserResolver- Specified by:
getUsersByUserKeysin interfaceUserAccessor- Parameters:
userKeys- the user keys- Returns:
- the list of ConfluenceUsers with UserKeys
-
getGroupsByGroupNames
Description copied from interface:UserAccessorReturns a list of Group objects where the names match that of the provided list of group names. If no names are provided an empty list will be returned.- Specified by:
getGroupsByGroupNamesin interfaceUserAccessor- Parameters:
groupNames- the list group names for which the matching Group objects must be returned- Returns:
- the list of resolved groups
-
countUnsyncedUsers
public int countUnsyncedUsers()Description copied from interface:UserAccessorGet a count of all unsynced users in Confluence. An unsynced user is a user that was managed in an external directory but has since been removed from the directory without being deleted in Confluence.- Specified by:
countUnsyncedUsersin interfaceUserAccessor- Returns:
- the total number of all unsynced users.
-
isLicensedToAddMoreUsers
public boolean isLicensedToAddMoreUsers()- Specified by:
isLicensedToAddMoreUsersin interfaceUserAccessor- Specified by:
isLicensedToAddMoreUsersin interfaceUserAccessor
-
isDeactivated
public boolean isDeactivated(com.atlassian.user.User user) Description copied from interface:UserAccessorReturns true if the user exists and is unable to log in, otherwise false. Returns false if the user is null.- Specified by:
isDeactivatedin interfaceUserAccessor- Specified by:
isDeactivatedin interfaceUserAccessor- Returns:
- true if the user exists and is unable to log in, otherwise false.
-
isDeactivated
Description copied from interface:UserAccessorReturns 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:
isDeactivatedin interfaceUserAccessor- Specified by:
isDeactivatedin interfaceUserAccessor- Returns:
- true if the user with the specified username exists and is unable to log in, otherwise false.
-
alterPassword
public void alterPassword(com.atlassian.user.User user, String plainTextPassword, String token) throws com.atlassian.user.EntityException - Specified by:
alterPasswordin interfaceUserAccessor- Throws:
com.atlassian.user.EntityException
-