public interface

SpacePermissionManager

com.atlassian.confluence.security.SpacePermissionManager
Known Indirect Subclasses

Class Overview

Responsible for the addition, modification and removal of space permissions. This interface is not for checking whether a user has permission to do something; for that see PermissionManager.

Summary

Public Methods
abstract void createInitialSpacePermissions(Space space)
Creates all the initial permissions (in this list GENERIC_SPACE_PERMISSIONS) in the specified space.
abstract void fixPermissions()
abstract void flushCaches()
abstract List<SpacePermission> getAllPermissionsForGroup(String group)
abstract List<SpacePermission> getGlobalPermissions()
abstract List<SpacePermission> getGlobalPermissions(String permissionType)
abstract Map getGroupsForPermissionType(String permissionType, Space space)
abstract Collection getGroupsWithPermissions(Space space)
Returns all groups wich have permissions in a space or on a global level.
abstract Map getUsersForPermissionType(String permissionType, Space space)
abstract Collection getUsersWithPermissions(Space space)
Returns a collection of user objects with VIEWSPACE_PERMISSION in the space.
abstract 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.
abstract boolean hasPermission(String permissionType, Space space, User remoteUser)
Determines if remoteUser has the given permission in space
abstract 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.
abstract boolean hasPermissionForSpace(User user, List permissionTypes, Space space)
abstract boolean permissionExists(SpacePermission permission)
Check whether the given SpacePermission exists.
abstract void removeAllPermissions(Space space)
Removes all permissions belonging to space
abstract void removeAllPermissionsForGroup(String group)
abstract void removeAllUserPermissions(String username)
abstract void removePermission(SpacePermission permission)
abstract void savePermission(SpacePermission permission)
Saves the permission.

Public Methods

public abstract void createInitialSpacePermissions (Space space)

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

public abstract void fixPermissions ()

public abstract void flushCaches ()

public abstract List<SpacePermission> getAllPermissionsForGroup (String group)

public abstract List<SpacePermission> getGlobalPermissions ()

public abstract List<SpacePermission> getGlobalPermissions (String permissionType)

public abstract Map getGroupsForPermissionType (String permissionType, Space space)

public abstract 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 abstract Map getUsersForPermissionType (String permissionType, Space space)

public abstract 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 abstract 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 abstract 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 abstract 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 abstract boolean hasPermissionForSpace (User user, List permissionTypes, Space space)

public abstract 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 abstract void removeAllPermissions (Space space)

Removes all permissions belonging to space

Parameters
space The space to remove the permissions for

public abstract void removeAllPermissionsForGroup (String group)

public abstract void removeAllUserPermissions (String username)

public abstract void removePermission (SpacePermission permission)

public abstract void savePermission (SpacePermission permission)

Saves the permission.