public interface UserAccessor extends UserAccessor
Modifier and Type | Field and Description |
---|---|
static String |
ANONYMOUS
Deprecated.
since 4.0 not used in Confluence
|
static List<String> |
DEFAULT_GROUP_NAMES
Deprecated.
since 5.2. Use @link{#getAllDefaultGroupNames()} instead.
|
static String |
GROUP_CONFLUENCE_ADMINS
The name of the group with special administration privileges in the application.
|
static String |
GROUP_CONFLUENCE_USERS
Deprecated.
since 5.2. Use @link{com.atlassian.confluence.setup.settings.Settings#getDefaultUsersGroup()} instead.
|
static String |
PROFILE_PICTURE_BUILTIN_PATH
Relative path to default profile pictures in the web application, used to determine whether
a user has uploaded a custom profile picture.
|
static String |
USER_GROUP_SUFFIX
Deprecated.
since 4.0 not used in Confluence
|
Modifier and Type | Method and Description |
---|---|
int |
countLicenseConsumingUsers()
Returns the number of users which have access to use Confluence AND consume a Confluence license.
|
int |
countUsersWithConfluenceAccess()
Deprecated.
Since 5.5 Includes users with Confluence access who do not consume Confluence licenses, such as add-on users. Call
countLicenseConsumingUsers() instead.
Returns the number of users which have access to use Confluence. Callers are strongly recommended to use the
UserChecker.getNumberOfRegisteredUsers() to retrieve this info, as that caches its results. |
ConfluenceUser |
createUser(com.atlassian.user.User userTemplate,
com.atlassian.user.security.password.Credential password) |
boolean |
exists(String name)
Returns true if a user exists with the given username.
|
List<com.atlassian.user.Group> |
filterUnaccessibleGroups(List<com.atlassian.user.Group> groups,
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.
|
List<com.atlassian.user.User> |
filterUnaccessibleUsers(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.
|
List<com.atlassian.user.User> |
findUsersAsList(com.atlassian.user.search.query.Query<com.atlassian.user.User> search) |
List<String> |
getAllDefaultGroupNames()
Deprecated.
Since 5.2. This method is vague and returns a collection containing the result of
Settings.getDefaultUsersGroup() and
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 . |
List<String> |
getGroupNames(com.atlassian.user.User user)
Gets the list of group names representing the groups the passed in user is a member of.
|
List<String> |
getGroupNamesForUserName(String userName)
Gets the list of group names representing the groups the passed in user is a member of.
|
List<com.atlassian.user.Group> |
getGroupsAsList() |
List<com.atlassian.user.Group> |
getGroupsAsList(com.atlassian.user.User user)
Deprecated.
since 3.5.4 callers should use
getGroupNames(User) or getGroupNamesForUserName(String) |
List<String> |
getMemberNamesAsList(com.atlassian.user.Group group)
Same as
UserAccessor.getMemberNames(com.atlassian.user.Group) but returns a List of user names as String s
rather than a Pager. |
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).
|
String |
getNewUserDefaultGroupName()
Deprecated.
since 5.2. Use
Settings.getDefaultUsersGroup() via
SettingsManager.getGlobalSettings() . |
com.opensymphony.module.propertyset.PropertySet |
getPropertySet(ConfluenceUser user) |
com.opensymphony.module.propertyset.PropertySet |
getPropertySet(com.atlassian.user.User user)
Deprecated.
since 5.2 - Use
getPropertySet(ConfluenceUser) |
com.atlassian.user.User |
getUser(String name)
Deprecated.
since 5.2. See
getUserByName(String) |
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(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(String username)
Deprecated.
since 5.2. Use
getUserByName(String) |
List<String> |
getUserNamesWithConfluenceAccess()
Returns the names of all users with access to use Confluence.
|
ProfilePictureInfo |
getUserProfilePicture(String username)
Deprecated.
since 2.9. Use
getUserProfilePicture(User) instead. |
ProfilePictureInfo |
getUserProfilePicture(com.atlassian.user.User user)
Retrieve the path to a user's personal picture
|
List<com.atlassian.user.User> |
getUsersWithConfluenceAccessAsList()
Deprecated.
since 3.5.1. This method is very slow. If you only need to know the number of users,
you should call
UserChecker.getNumberOfRegisteredUsers() , as that caches its results.
If you need to know the usernames, you should call getUserNamesWithConfluenceAccess() , as that is a higher
performance implementation. |
List<com.atlassian.user.Group> |
getWriteableGroups()
Gets all editable groups.
|
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)
Deprecated.
since 3.5 the permission checks in the application take care of checking for this membership
|
ConfluenceUser |
renameUser(ConfluenceUser user,
String newUsername)
Updates the username of the given user.
|
void |
setUserProfilePicture(com.atlassian.user.User user,
Attachment attachment)
Set the user profile picture to the given attachment.
|
void |
setUserProfilePicture(com.atlassian.user.User targetUser,
String imagePath)
Set the user profile picture to a built-in image.
|
addGroup, addMembership, addMembership, addUser, addUser, alterPassword, authenticate, createGroup, createUser, deactivateUser, findUsers, getDelegatingRepositories, getExternallMembers, getGroup, getGroupCreateIfNecessary, getGroups, getGroups, getLocalMembers, getMemberNames, getRepository, getUserNames, getUserPreferences, getUsers, getUsersByEmail, getUsersWithConfluenceAccess, hasMembership, hasMembership, isDeactivated, isDeactivated, isLicensedToAddMoreUsers, isUserRemovable, reactivateUser, removeGroup, removeMembership, removeMembership, removeUser, saveUser
@Deprecated static final String ANONYMOUS
@Deprecated static final String GROUP_CONFLUENCE_USERS
@Deprecated static final String USER_GROUP_SUFFIX
static final String GROUP_CONFLUENCE_ADMINS
@Deprecated static final List<String> DEFAULT_GROUP_NAMES
static final String PROFILE_PICTURE_BUILTIN_PATH
@Deprecated com.atlassian.user.User getUser(String name)
getUserByName(String)
null
if the user doesn't exist or the name is null
.
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.getUser
in interface UserAccessor
name
- the user name of the userConfluenceUser getUserByName(String name)
name
- the user name of the userConfluenceUser getUserByKey(com.atlassian.sal.api.user.UserKey key)
null
if the user has never existed or the key is
null
.
WARNING: This method can return deleted users. Use
getExistingUserByKey(com.atlassian.sal.api.user.UserKey)
to get only users that exist.
ConfluenceUser getExistingUserByKey(com.atlassian.sal.api.user.UserKey key)
null
if the user doesn't exist or the key is
null
.boolean exists(String name)
getUser(name) != null
.name
- username of the userConfluenceUser createUser(com.atlassian.user.User userTemplate, com.atlassian.user.security.password.Credential password)
createUser
in interface UserAccessor
boolean isReadOnly(com.atlassian.user.User user)
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
.boolean isReadOnly(com.atlassian.user.Group group)
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
.@Deprecated 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 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 ProfilePictureInfo getUserProfilePicture(String username)
getUserProfilePicture(User)
instead.username
- the user whose picture to look up.ProfilePictureInfo getUserProfilePicture(com.atlassian.user.User user)
user
- the user whose picture to look up.ConfluenceUserPreferences getConfluenceUserPreferences(com.atlassian.user.User user)
@Deprecated boolean isSuperUser(com.atlassian.user.User user)
user
- the user to check for (the null user will always return false@Deprecated List<com.atlassian.user.User> filterUnaccessibleUsers(List<com.atlassian.user.User> users, com.atlassian.user.User user)
@Deprecated List<com.atlassian.user.Group> getGroupsAsList(com.atlassian.user.User user)
getGroupNames(User)
or getGroupNamesForUserName(String)
@Deprecated List<com.atlassian.user.Group> filterUnaccessibleGroups(List<com.atlassian.user.Group> groups, com.atlassian.user.User user)
List<com.atlassian.user.Group> getGroupsAsList()
List<String> getMemberNamesAsList(com.atlassian.user.Group group)
UserAccessor.getMemberNames(com.atlassian.user.Group)
but returns a List of user names as String
s
rather than a Pager.group
- to retrieve the member names fromString
sIterable<ConfluenceUser> getMembers(com.atlassian.user.Group group)
Elements are generated on demand and it is recommended to fetch only as many elements as are needed.
group
- group to get members forList<String> getGroupNames(com.atlassian.user.User user)
user
- the user to perform the membership check forList<String> getGroupNamesForUserName(String userName)
userName
- the name of the user to perform the membership check forList<com.atlassian.user.Group> getWriteableGroups()
Group
s that can be edited.@Deprecated com.opensymphony.module.propertyset.PropertySet getPropertySet(com.atlassian.user.User user)
getPropertySet(ConfluenceUser)
getPropertySet
in interface UserAccessor
com.opensymphony.module.propertyset.PropertySet getPropertySet(ConfluenceUser user)
user
- @Deprecated List<com.atlassian.user.User> getUsersWithConfluenceAccessAsList()
UserChecker.getNumberOfRegisteredUsers()
, as that caches its results.
If you need to know the usernames, you should call getUserNamesWithConfluenceAccess()
, as that is a higher
performance implementation.countUsersWithConfluenceAccess()
List<String> getUserNamesWithConfluenceAccess()
UserChecker.getNumberOfRegisteredUsers()
, as that caches its results.UserChecker
@Deprecated int countUsersWithConfluenceAccess()
countLicenseConsumingUsers()
instead.
Returns the number of users which have access to use Confluence. Callers are strongly recommended to use the
UserChecker.getNumberOfRegisteredUsers()
to retrieve this info, as that caches its results.UserChecker
int countLicenseConsumingUsers()
UserChecker.getNumberOfRegisteredUsers()
to retrieve this info, as that caches its results.UserChecker
@Deprecated com.atlassian.user.User getUserIfAvailable(String username)
getUserByName(String)
List<com.atlassian.user.User> findUsersAsList(com.atlassian.user.search.query.Query<com.atlassian.user.User> search) throws com.atlassian.user.EntityException
com.atlassian.user.EntityException
void setUserProfilePicture(com.atlassian.user.User user, Attachment attachment)
user
- the user to set a profile picture forattachment
- the attachment containing the user's profile pictureIllegalArgumentException
- if the image is not attached to the user's personal informationvoid setUserProfilePicture(com.atlassian.user.User targetUser, String imagePath)
targetUser
- the user to set a profile picture forimagePath
- the image path to that picture.@Deprecated List<String> getAllDefaultGroupNames()
Settings.getDefaultUsersGroup()
and
GROUP_CONFLUENCE_ADMINS
. Clients should explicitly decide what they need and use that.@Deprecated String getNewUserDefaultGroupName()
Settings.getDefaultUsersGroup()
via
SettingsManager.getGlobalSettings()
.ConfluenceUser renameUser(ConfluenceUser user, String newUsername) throws com.atlassian.user.EntityException
user
- user to renamenewUsername
- username to use for renamingcom.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 userUserManagementOperationFailedException
- if the operation fails for unknown reasoncom.atlassian.user.impl.DuplicateEntityException
- if the username is already takenCopyright © 2003–2015 Atlassian. All rights reserved.