Class ReadOnlySpacePermissionManager
- All Implemented Interfaces:
- SpacePermissionManagerInternal,- SpacePermissionSaverInternal,- SpacePermissionManager,- SpacePermissionSaver
- 
Constructor SummaryConstructorsConstructorDescriptionReadOnlySpacePermissionManager(SpacePermissionManager spacePermissionManager) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidvoidReturns the default global permissions that are created when Confluence is set up.getGlobalPermissions(String arg0) getGroupsForPermissionType(String arg0, Space arg1) Collection<com.atlassian.user.Group> getGroupsWithPermissions(@Nullable Space arg0) Returns all groups which have permissions in a space or on a global level.Get all permissions granted to the anonymous users in the given spacegetPermissionsForGroup(String group, Space space) Get all permissions for the given group in the specified spacegetPermissionsForUser(ConfluenceUser user, Space space) Get all permissions for the given user in the specified spacegetUsersForPermissionType(String arg0, Space arg1) getUsersWithPermissions(@Nullable Space arg0) Returns a collection of user objects with VIEWSPACE_PERMISSION in the space.booleangroupHasPermission(String arg0, @Nullable Space arg1, String arg2) Checks whether the given group has the given permissionbooleanhasAllPermissions(List<String> permissionTypes, @Nullable Space space, @Nullable ConfluenceUser user) Determines if remoteUser has all of the given permissions in spacebooleanhasPermission(String arg0, @Nullable Space arg1, @Nullable ConfluenceUser arg2) Determines if remoteUser has the given permission in spacebooleanhasPermissionForSpace(@Nullable ConfluenceUser arg0, List arg1, @Nullable Space arg2) booleanhasPermissionNoExemptions(String permissionType, @Nullable Space space, @Nullable ConfluenceUser remoteUser) Returns true if the user has the specified permission on the target space.booleanisPermittedInReadOnlyAccessMode(String permissionType) Check if the permission type is permitted in read only access modebooleanCheck whether the given SpacePermission exists.voidremoveAllPermissions(Space space) Deprecated.voidremoveAllPermissions(Space space, SpacePermissionContext context) Removes all permissions belonging to spacevoidDeprecated.voidremoveAllPermissionsForGroup(String group, SpacePermissionContext context) Removes all permissions for the given group.voidremoveAllUserPermissions(@NonNull ConfluenceUser user) Deprecated.voidremoveAllUserPermissions(ConfluenceUser user, SpacePermissionContext context) Removes all permissions for the given user.voidremoveGlobalPermissionForUser(ConfluenceUser user, String permissionType) Deprecated.voidremoveGlobalPermissionForUser(ConfluenceUser user, String permissionType, SpacePermissionContext context) Removes global permission of specified type that is directly associated with a user.voidremovePermission(SpacePermission permission) Deprecated.voidremovePermission(SpacePermission permission, SpacePermissionContext context) Removes the given permission.voidremovePermissions(Collection<SpacePermission> permissionsToRemove, SpacePermissionContext context) Removes the given permissions.voidsaveGlobalPermissions(Collection<SpacePermission> spacePermissions, SpacePermissionContext context) Adds global permissionsvoidsavePermission(SpacePermission permission) Deprecated.voidsavePermission(SpacePermission permission, SpacePermissionContext context) Saves the permission.voidsaveSpacePermissions(Space space, Collection<SpacePermission> spacePermissions, SpacePermissionContext context) Adds space permissions to the space
- 
Constructor Details- 
ReadOnlySpacePermissionManager
 
- 
- 
Method Details- 
createDefaultSpacePermissions- Specified by:
- createDefaultSpacePermissionsin interface- SpacePermissionManager
 
- 
createPrivateSpacePermissions- Specified by:
- createPrivateSpacePermissionsin interface- SpacePermissionManager
 
- 
flushCachespublic void flushCaches()- Specified by:
- flushCachesin interface- SpacePermissionManager
 
- 
getAllPermissionsForGroup- Specified by:
- getAllPermissionsForGroupin interface- SpacePermissionManager
 
- 
getGlobalPermissions- Specified by:
- getGlobalPermissionsin interface- SpacePermissionManager
 
- 
getGlobalPermissions- Specified by:
- getGlobalPermissionsin interface- SpacePermissionManager
 
- 
getGroupsForPermissionType- Specified by:
- getGroupsForPermissionTypein interface- SpacePermissionManager
 
- 
getGroupsWithPermissionsDescription copied from interface:SpacePermissionManagerReturns all groups which have permissions in a space or on a global level. If space is null, permissions on the global level will be checked.- Specified by:
- getGroupsWithPermissionsin interface- SpacePermissionManager
- Parameters:
- arg0- - space to query, if null global permissions returned
- Returns:
- Collection of groups with permissions
 
- 
getUsersForPermissionType- Specified by:
- getUsersForPermissionTypein interface- SpacePermissionManager
 
- 
getUsersWithPermissionsDescription copied from interface:SpacePermissionManagerReturns 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- Specified by:
- getUsersWithPermissionsin interface- SpacePermissionManager
- Parameters:
- arg0- - space to query, if null global permissions returned
- Returns:
- Collection of User objects
 
- 
groupHasPermissionDescription copied from interface:SpacePermissionManagerChecks whether the given group has the given permissionIf 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. - Specified by:
- groupHasPermissionin interface- SpacePermissionManager
- Parameters:
- arg0- The permission type to look up
- arg1- The space the permission applies to (can be null for global permissions)
- arg2- The group to look up the permission for
- Returns:
- true if the group has the required permission, false otherwise
 
- 
hasPermissionDescription copied from interface:SpacePermissionManagerDetermines if remoteUser has the given permission in spaceUnless you're writing code that is part of the permission checking implementation, or you're changing space permissions, you should be using PermissionManagerinstead.- Specified by:
- hasPermissionin interface- SpacePermissionManager
- Parameters:
- arg0- The permission type to look up
- arg1- The space the permission applies to (can be null for global permissions)
- Returns:
- true if remoteUser has the permission, false otherwise
 
- 
hasPermissionNoExemptionspublic boolean hasPermissionNoExemptions(String permissionType, @Nullable Space space, @Nullable ConfluenceUser remoteUser) Description copied from interface:SpacePermissionManagerReturns true if the user has the specified permission on the target space. This method does not allow exemptions for super-users likeSpacePermissionManager.hasPermission(String, Space, ConfluenceUser)does.For parameter and return value information, see SpacePermissionManager.hasPermission(String, Space, ConfluenceUser).- Specified by:
- hasPermissionNoExemptionsin interface- SpacePermissionManager
 
- 
hasAllPermissionspublic boolean hasAllPermissions(List<String> permissionTypes, @Nullable Space space, @Nullable ConfluenceUser user) Description copied from interface:SpacePermissionManagerDetermines if remoteUser has all of the given permissions in spaceIf remoteUser lacks any of the given permissions, false is returned. Unless you're writing code that is part of the permission checking implementation, or you're changing space permissions, you should be using PermissionManagerinstead.- Specified by:
- hasAllPermissionsin interface- SpacePermissionManager
- Parameters:
- permissionTypes- A List of permission types (see SpacePermission) to check
- space- The space the permissions apply to
- user- The user to look up
- Returns:
- true if remoteUser has the permission, false otherwise
 
- 
hasPermissionForSpacepublic boolean hasPermissionForSpace(@Nullable ConfluenceUser arg0, List arg1, @Nullable Space arg2) - Specified by:
- hasPermissionForSpacein interface- SpacePermissionManager
 
- 
permissionExistsDescription copied from interface:SpacePermissionManagerCheck whether the given SpacePermission exists. Checks by attribute equality rather than by id.- Specified by:
- permissionExistsin interface- SpacePermissionManager
- Parameters:
- arg0- the permission to look for.
- Returns:
- true if the permission is recognised by the manager as existing.
 
- 
getDefaultGlobalPermissionsDescription copied from interface:SpacePermissionManagerReturns the default global permissions that are created when Confluence is set up. These will exist in a newly set up system but may be removed afterwards. Note that the returned objects are freshly created and therefore do not have IDs or other persistence data.By default, confluence-administrators group has admin access, the default confluence users group can view the system and anonymous access is disabled. - Specified by:
- getDefaultGlobalPermissionsin interface- SpacePermissionManager
- Returns:
- a collection of SpacePermissions.
 
- 
isPermittedInReadOnlyAccessModeDescription copied from interface:SpacePermissionManagerCheck if the permission type is permitted in read only access mode- Specified by:
- isPermittedInReadOnlyAccessModein interface- SpacePermissionManager
- Parameters:
- permissionType- the permission type to be checked
- Returns:
- true if the permission type is permitted in read only access mode
 
- 
removeAllPermissionsDeprecated.Description copied from interface:SpacePermissionManagerRemoves all permissions belonging to space- Specified by:
- removeAllPermissionsin interface- SpacePermissionManager
- Parameters:
- space- The space to remove the permissions for
 
- 
removeAllPermissionsDescription copied from interface:SpacePermissionManagerInternalRemoves all permissions belonging to space- Specified by:
- removeAllPermissionsin interface- SpacePermissionManagerInternal
- Parameters:
- space- The space to remove the permissions for
- context- The context for this removal
 
- 
removeAllPermissionsForGroupDeprecated.Description copied from interface:SpacePermissionManagerRemoves all permissions for the given group, and generates aSpacePermissionsRemoveForGroupEventin the process.- Specified by:
- removeAllPermissionsForGroupin interface- SpacePermissionManager
- Parameters:
- group- the group to remove
 
- 
getPermissionsForUserDescription copied from interface:SpacePermissionManagerGet all permissions for the given user in the specified space- Specified by:
- getPermissionsForUserin interface- SpacePermissionManager
- Parameters:
- user- the user to look up
- space- the space entity
- Returns:
- a list of space permissions granted to the user in the given space
 
- 
getPermissionsForGroupDescription copied from interface:SpacePermissionManagerGet all permissions for the given group in the specified space- Specified by:
- getPermissionsForGroupin interface- SpacePermissionManager
- Parameters:
- group- the name of the group
- space- the space entity
- Returns:
- a list of space permissions granted to the group in the given space
 
- 
getPermissionsForAnonymousUsersDescription copied from interface:SpacePermissionManagerGet all permissions granted to the anonymous users in the given space- Specified by:
- getPermissionsForAnonymousUsersin interface- SpacePermissionManager
- Parameters:
- space- the space entity
- Returns:
- a list of space permissions granted to anonymous users in the given space
 
- 
removeAllPermissionsForGroupDescription copied from interface:SpacePermissionManagerInternalRemoves all permissions for the given group.May generate a SpacePermissionsRemoveForGroupEventin the process, depending on the context.- Specified by:
- removeAllPermissionsForGroupin interface- SpacePermissionManagerInternal
- Parameters:
- group- the group to remove
 
- 
removeAllUserPermissionsDeprecated.Description copied from interface:SpacePermissionManagerRemoves all permissions for the given user, and generates aSpacePermissionsRemoveForUserEventin the process.- Specified by:
- removeAllUserPermissionsin interface- SpacePermissionManager
 
- 
removeAllUserPermissionsDescription copied from interface:SpacePermissionManagerInternalRemoves all permissions for the given user.May generate a SpacePermissionsRemoveForUserEventin the process, depending on the context.- Specified by:
- removeAllUserPermissionsin interface- SpacePermissionManagerInternal
- Parameters:
- user- the user to remove permissions for
- context- the context for the removal
 
- 
removeGlobalPermissionForUserDeprecated.Description copied from interface:SpacePermissionManagerRemoves global permission of specified type that is directly associated with a user, and generates aSpacePermissionsRemoveForUserEventin the process.- Specified by:
- removeGlobalPermissionForUserin interface- SpacePermissionManager
- Parameters:
- user- the user to look up
- permissionType- the permission type to remove
 
- 
removeGlobalPermissionForUserpublic void removeGlobalPermissionForUser(ConfluenceUser user, String permissionType, SpacePermissionContext context) Description copied from interface:SpacePermissionManagerInternalRemoves global permission of specified type that is directly associated with a user.May generate a SpacePermissionsRemoveForUserEventin the process, depending on the context.- Specified by:
- removeGlobalPermissionForUserin interface- SpacePermissionManagerInternal
- Parameters:
- user- the user to look up
- permissionType- the permission type to remove
- context- the context for the removal
 
- 
removePermissionDeprecated.Description copied from interface:SpacePermissionManagerRemoves the given permission, and generates aSpacePermissionRemoveEventin the process.- Specified by:
- removePermissionin interface- SpacePermissionManager
- Parameters:
- permission- the permission to remove
 
- 
removePermissionDescription copied from interface:SpacePermissionManagerInternalRemoves the given permission.May generate a SpacePermissionRemoveEventin the process, depending on the context.- Specified by:
- removePermissionin interface- SpacePermissionManagerInternal
- Parameters:
- permission- the permission to remove
- context- the context for the removal
 
- 
removePermissionspublic void removePermissions(Collection<SpacePermission> permissionsToRemove, SpacePermissionContext context) Description copied from interface:SpacePermissionManagerInternalRemoves the given permissions.May generate a SpacePermissionRemoveEventin the process, depending on the context.- Specified by:
- removePermissionsin interface- SpacePermissionManagerInternal
- Parameters:
- permissionsToRemove- the permissions to remove
- context- the context for the removal
 
- 
savePermissionDeprecated.Description copied from interface:SpacePermissionSaverSaves the permission, and generates aSpacePermissionSaveEventin the process.- Specified by:
- savePermissionin interface- SpacePermissionSaver
 
- 
savePermissionDescription copied from interface:SpacePermissionSaverInternalSaves the permission.May generate a SpacePermissionSaveEventin the process, depending on the context.- Specified by:
- savePermissionin interface- SpacePermissionSaverInternal
- Parameters:
- permission- the permission to save
- context- the context for the save
 
- 
saveSpacePermissionspublic void saveSpacePermissions(Space space, Collection<SpacePermission> spacePermissions, SpacePermissionContext context) Description copied from interface:SpacePermissionSaverInternalAdds space permissions to the space- Specified by:
- saveSpacePermissionsin interface- SpacePermissionSaverInternal
- Parameters:
- space- Space to which permissions should be granted
- spacePermissions- Collection of space permissions. They should all belong to the same space.
- context- the context of the save
 
- 
saveGlobalPermissionspublic void saveGlobalPermissions(Collection<SpacePermission> spacePermissions, SpacePermissionContext context) Description copied from interface:SpacePermissionSaverInternalAdds global permissions- Specified by:
- saveGlobalPermissionsin interface- SpacePermissionSaverInternal
- Parameters:
- spacePermissions- Collection of global permissions.
- context- the context of the save
 
 
-