public class

SpacePermissionCheckDispatcherCoordinator

extends Object
implements SpacePermissionManager
java.lang.Object
   ↳ com.atlassian.confluence.security.SpacePermissionCheckDispatcherCoordinator

Class Overview

Space permission manager wrapper that updates the permission check dispatcher cache on operations that add or remove permissions.

Summary

Public Constructors
SpacePermissionCheckDispatcherCoordinator()
Public Methods
void createInitialSpacePermissions(Space space)
Creates all the initial permissions (in this list GENERIC_SPACE_PERMISSIONS) in the specified space.
void fixPermissions()
void flushCaches()
List getAllPermissionsForGroup(String group)
List getGlobalPermissions()
List getGlobalPermissions(String permissionType)
Map getGroupsForPermissionType(String permissionType, Space space)
Collection getGroupsWithPermissions(Space space)
Returns all groups wich have permissions in a space or on a global level.
Map getUsersForPermissionType(String permissionType, Space space)
Collection getUsersWithPermissions(Space space)
Returns a collection of user objects with VIEWSPACE_PERMISSION in the space.
boolean groupHasPermission(String permissionType, Space space, String group)
Checks whether the given group has the given permission

If a null space is specified, this method looks up matching global permissions, otherwise space's permissions list is queried to see if the permission matches.
boolean hasPermission(String permissionType, Space space, User remoteUser)
Determines if remoteUser has the given permission in space
boolean hasPermission(List permissionTypes, Space space, User remoteUser)
Determines if remoteUser has the given permissions in space

If remoteUser lacks any of the given permissions, false is returned.
boolean hasPermissionForSpace(User user, List permissionTypes, Space space)
boolean permissionExists(SpacePermission permission)
Check whether the given SpacePermission exists.
void removeAllPermissions(Space space)
Removes all permissions belonging to space
void removeAllPermissionsForGroup(String group)
void removeAllUserPermissions(String username)
void removePermission(SpacePermission permission)
void savePermission(SpacePermission permission)
Saves the permission.
void setPermissionCheckDispatcherResultCache(PermissionCheckDispatcherResultCache permissionCheckDispatcherResultCache)
void setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.security.SpacePermissionManager

Public Constructors

public SpacePermissionCheckDispatcherCoordinator ()

Public Methods

public void createInitialSpacePermissions (Space space)

Creates all the initial permissions (in this list GENERIC_SPACE_PERMISSIONS) in the specified space.

public void fixPermissions ()

public void flushCaches ()

public List getAllPermissionsForGroup (String group)

public List getGlobalPermissions ()

public List getGlobalPermissions (String permissionType)

public Map getGroupsForPermissionType (String permissionType, Space space)

public Collection getGroupsWithPermissions (Space space)

Returns all groups wich have permissions in a space or on a global level. If space is null, permissions on the global level will be checked.

Parameters
space - space to query, if null global permissions returned
Returns
  • Collection of groups with permissions

public Map getUsersForPermissionType (String permissionType, Space space)

public Collection getUsersWithPermissions (Space space)

Returns a collection of user objects with VIEWSPACE_PERMISSION in the space. If no space is provided A list of users with USE_CONFLUENCE_PERMISSION will be returned

Parameters
space - space to query, if null global permissions returned
Returns
  • Collection of User objects

public boolean groupHasPermission (String permissionType, Space space, String group)

Checks whether the given group has the given permission

If a null space is specified, this method looks up matching global permissions, otherwise space's permissions list is queried to see if the permission matches.

Similarly, if permissionType is not a space permission, a matching global permission is looked up.
Parameters
permissionType The permission type to look up
space The space the permission applies to (can be null for global permissions)
group The group to look up the permission for
Returns
  • true if the group has the required permission, false otherwise

public boolean hasPermission (String permissionType, Space space, User remoteUser)

Determines if remoteUser has the given permission in space

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

public boolean hasPermission (List permissionTypes, Space space, User remoteUser)

Determines if remoteUser has the given permissions in space

If remoteUser lacks any of the given permissions, false is returned.
Parameters
permissionTypes A List of permission types (see SpacePermission) to check
space The space the permissions apply to
remoteUser The user to look up
Returns
  • true if remoteUser has the permission, false otherwise

public boolean hasPermissionForSpace (User user, List permissionTypes, Space space)

public boolean permissionExists (SpacePermission permission)

Check whether the given SpacePermission exists. Checks by attribute equality rather than by id.

Parameters
permission the permission to look for.
Returns
  • true if the permission is recognised by the manager as existing.

public void removeAllPermissions (Space space)

Removes all permissions belonging to space

Parameters
space The space to remove the permissions for

public void removeAllPermissionsForGroup (String group)

public void removeAllUserPermissions (String username)

public void removePermission (SpacePermission permission)

public void savePermission (SpacePermission permission)

Saves the permission.

public void setPermissionCheckDispatcherResultCache (PermissionCheckDispatcherResultCache permissionCheckDispatcherResultCache)

public void setSpacePermissionManager (SpacePermissionManager spacePermissionManager)