public interface

UserAccessor

implements UserAccessor
com.atlassian.confluence.user.UserAccessor
Known Indirect Subclasses

Summary

Constants
String ANONYMOUS
String GROUP_CONFLUENCE_ADMINS
String GROUP_CONFLUENCE_USERS
String PROFILE_PICTURE_BUILTIN_PATH
String USER_GROUP_SUFFIX
Fields
public static final List DEFAULT_GROUP_NAMES List of names (as Strings) that are automatically created during Confluence setup.
Public Methods
abstract Pager filterUnaccessibleGroups(Pager groupPager, User user)
Filters a pager of groups based on the passed User.
abstract List filterUnaccessibleGroups(List groupList, User user)
abstract Pager filterUnaccessibleUsers(Pager userPager, User user)
Filters a pager of Users based on the groups of the passed com.atlassian.user.User.
abstract List filterUnaccessibleUsers(List groupList, User user)
Filters a pager of groups based on the passed User.
abstract List findUsersAsList(Query search)
abstract ConfluenceUserPreferences getConfluenceUserPreferences(User user)
abstract List getGroupsAsList()
abstract List<Group> getGroupsAsList(User user)
abstract List<String> getMemberNamesAsList(Group group)
Same as getMemberNames(com.atlassian.user.Group) but returns a List of user names as Strings rather than a Pager.
abstract User getUserIfAvailable(String username)
Get the User if visible to the currently authenticated user in shared mode.
abstract ProfilePictureInfo getUserProfilePicture(User user)
Retrieve the path to a user's personal picture
abstract ProfilePictureInfo getUserProfilePicture(String username)
This method is deprecated. since 2.9. Use getUserProfilePicture(User) instead.
abstract List<User> getUsersWithConfluenceAccessAsList()
abstract List<Group> getWriteableGroups()
Gets all editable groups.
abstract boolean isReadOnly(Group group)
abstract boolean isReadOnly(User user)
abstract boolean isSuperUser(User user)
Return true if the user is an all-powerful super-user (member of the confluence-administrators group).
abstract void setContentEntityManager(ContentEntityManager contentEntityManager)
abstract void setEventManager(EventManager eventManager)
abstract void setNotificationManager(NotificationManager notificationManager)
abstract void setPersonalInformationManager(PersonalInformationManager personalInformationManager)
abstract void setSettingsManager(SettingsManager settingsManager)
abstract void setSpacePermissionManager(SpacePermissionManager permissionManager)
abstract void setUserProfilePicture(User targetUser, String imagePath)
Set the user profile picture to a built-in image.
abstract void setUserProfilePicture(User user, Attachment attachment)
Set the user profile picture to the given attachment.
abstract void setUserStatusManager(UserStatusManager userStatusManager)
[Expand]
Inherited Methods
From interface bucket.user.UserAccessor
From interface com.atlassian.user.search.query.EntityQueryParser

Constants

public static final String ANONYMOUS

Constant Value: "confluence-anonymous"

public static final String GROUP_CONFLUENCE_ADMINS

Constant Value: "confluence-administrators"

public static final String GROUP_CONFLUENCE_USERS

Constant Value: "confluence-users"

public static final String PROFILE_PICTURE_BUILTIN_PATH

Constant Value: "/images/icons/profilepics/"

public static final String USER_GROUP_SUFFIX

Constant Value: "-users"

Fields

public static final List DEFAULT_GROUP_NAMES

List of names (as Strings) that are automatically created during Confluence setup.

Public Methods

public abstract Pager filterUnaccessibleGroups (Pager groupPager, User user)

Filters a pager of groups based on the passed User. If in "shared" mode and the user isn't a global administrator, only the groups of the user will be returned. Otherwise, the pager will be returned unmodified.

Parameters
groupPager The pager of groups
user The user to filter against
Returns
  • A filtered Pager of Group objects

public abstract List filterUnaccessibleGroups (List groupList, User user)

public abstract Pager filterUnaccessibleUsers (Pager userPager, User user)

Filters a pager of Users based on the groups of the passed com.atlassian.user.User. If in "shared" mode and the user isn't a global administrator, only users who are members of the same groups will be returned. Otherwise, the pager will be returned unmodified.

Parameters
userPager A Pager of User objects
user The user to filter against
Returns
  • a filtered Pager of com.atlassian.user.User objects

public abstract List filterUnaccessibleUsers (List groupList, User user)

Filters a pager of groups based on the passed User. If in "shared" mode and the user isn't a global administrator, only the groups of the user will be returned. Otherwise, the pager will be returned unmodified.

Parameters
groupList The list of groups
user The user to filter against
Returns
  • A filtered List of Group objects

public abstract List findUsersAsList (Query search)

Throws
EntityException

public abstract ConfluenceUserPreferences getConfluenceUserPreferences (User user)

public abstract List getGroupsAsList ()

public abstract List<Group> getGroupsAsList (User user)

public abstract List<String> getMemberNamesAsList (Group group)

Same as 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

public abstract User getUserIfAvailable (String username)

Get the User if visible to the currently authenticated user in shared mode. If not in shared mode, the User will be returned if not null.

public abstract ProfilePictureInfo getUserProfilePicture (User user)

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.

public abstract ProfilePictureInfo getUserProfilePicture (String username)

This method is deprecated.
since 2.9. Use getUserProfilePicture(User) instead.

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.

public abstract List<User> getUsersWithConfluenceAccessAsList ()

public abstract List<Group> getWriteableGroups ()

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.

public abstract boolean isReadOnly (Group group)

public abstract boolean isReadOnly (User user)

public abstract boolean isSuperUser (User user)

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.

public abstract void setContentEntityManager (ContentEntityManager contentEntityManager)

public abstract void setEventManager (EventManager eventManager)

public abstract void setNotificationManager (NotificationManager notificationManager)

public abstract void setPersonalInformationManager (PersonalInformationManager personalInformationManager)

public abstract void setSettingsManager (SettingsManager settingsManager)

public abstract void setSpacePermissionManager (SpacePermissionManager permissionManager)

public abstract void setUserProfilePicture (User targetUser, String imagePath)

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
targetUser the user to set a profile picture for
imagePath the image path to that picture.

public abstract void setUserProfilePicture (User user, Attachment attachment)

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
Throws
IllegalArgumentException if the image is not attached to the user's personal information

public abstract void setUserStatusManager (UserStatusManager userStatusManager)