public class

DefaultSpaceGroupPermissionManager

extends Object
implements SpaceGroupPermissionManager
java.lang.Object
   ↳ com.atlassian.confluence.hosted.DefaultSpaceGroupPermissionManager

Summary

Public Constructors
DefaultSpaceGroupPermissionManager(SpaceGroupPermissionDao spaceGroupPermissionDao)
Public Methods
List<SpaceGroupPermission> getPermissionsForUser(String username)
Get space group permissions for the user.
List<String> getUsersWithPermission(SpaceGroup spaceGroup, String type)
Returns a collection of usernames with VIEWSPACEGROUP_PERMISSION in the spacegroup.
boolean hasPermission(String permissionType, SpaceGroup spaceGroup, User remoteUser)
Determines if remoteUser has the given permission in space
void removeAllGroupPermissions(String groupname)
Removes all permissions on the space-group for a particular user-group
void removeAllPermissionsForSpaceGroup(SpaceGroup spaceGroup)
Removes all permissions on the space-group for a particular SpaceGroup
void removeAllUserPermissions(String username)
Removes all permissions on the space-group for a particular user
void removePermission(SpaceGroupPermission permission)
Removes a single SpaceGroupPermission
void savePermission(SpaceGroupPermission permission)
Saves the permission.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.hosted.SpaceGroupPermissionManager

Public Constructors

public DefaultSpaceGroupPermissionManager (SpaceGroupPermissionDao spaceGroupPermissionDao)

Public Methods

public List<SpaceGroupPermission> getPermissionsForUser (String username)

Get space group permissions for the user.

Returns
  • space group permissions for the user.

public List<String> getUsersWithPermission (SpaceGroup spaceGroup, String type)

Returns a collection of usernames with VIEWSPACEGROUP_PERMISSION in the spacegroup. If no space is provided A list of users with USE_CONFLUENCE_PERMISSION will be returned

Parameters
spaceGroup - space to query, if null global permissions returned
Returns
  • Collection of ssernames

public boolean hasPermission (String permissionType, SpaceGroup spaceGroup, User remoteUser)

Determines if remoteUser has the given permission in space

Parameters
permissionType The permission type to look up
spaceGroup The spacegroup the permission applies to (can not be null)
remoteUser The user to look up (can be null for the anonymous user)
Returns
  • true if remoteUser has the permission, false otherwise

public void removeAllGroupPermissions (String groupname)

Removes all permissions on the space-group for a particular user-group

Parameters
groupname the name of the user group

public void removeAllPermissionsForSpaceGroup (SpaceGroup spaceGroup)

Removes all permissions on the space-group for a particular SpaceGroup

Parameters
spaceGroup the name of the SpaceGroup

public void removeAllUserPermissions (String username)

Removes all permissions on the space-group for a particular user

Parameters
username the name of the user whose permissions should be removed

public void removePermission (SpaceGroupPermission permission)

Removes a single SpaceGroupPermission

Parameters
permission The SpaceGroupPermission that should be removed

public void savePermission (SpaceGroupPermission permission)

Saves the permission.