@ParametersAreNonnullByDefault public class SpacePermissionCoordinator extends Object implements SpacePermissionManagerInternal
PermissionManager and SetSpacePermissionChecker before forwarding the call to the underlying space permission manager.| Constructor and Description |
|---|
SpacePermissionCoordinator() |
| Modifier and Type | Method and Description |
|---|---|
void |
createDefaultSpacePermissions(Space space) |
void |
createPrivateSpacePermissions(Space space) |
void |
flushCaches() |
List<SpacePermission> |
getAllPermissionsForGroup(String group) |
Set<SpacePermission> |
getDefaultGlobalPermissions()
Returns the default global permissions that are created when Confluence is set up.
|
List<SpacePermission> |
getGlobalPermissions() |
List<SpacePermission> |
getGlobalPermissions(String permissionType) |
Map<String,Long> |
getGroupsForPermissionType(String permissionType,
Space space) |
Collection<com.atlassian.user.Group> |
getGroupsWithPermissions(@Nullable Space space)
Returns all groups which have permissions in a space or on a global level.
|
Map<String,Long> |
getUsersForPermissionType(String permissionType,
Space space) |
Collection<com.atlassian.user.User> |
getUsersWithPermissions(@Nullable Space space)
Returns a collection of user objects with VIEWSPACE_PERMISSION in the space.
|
boolean |
groupHasPermission(String permissionType,
@Nullable Space space,
String group)
Checks whether the given group has the given permission
|
boolean |
hasAllPermissions(List<String> permissionTypes,
@Nullable Space space,
@Nullable com.atlassian.user.User remoteUser)
Determines if remoteUser has all of the given permissions in space
|
boolean |
hasPermission(String permissionType,
@Nullable Space space,
@Nullable com.atlassian.user.User remoteUser)
Determines if remoteUser has the given permission in space
|
boolean |
hasPermissionForSpace(@Nullable com.atlassian.user.User user,
List permissionTypes,
@Nullable Space space) |
boolean |
hasPermissionNoExemptions(String permissionType,
@Nullable Space space,
@Nullable com.atlassian.user.User remoteUser)
Returns true if the user has the specified permission on the target space.
|
boolean |
isPermittedInReadOnlyAccessMode(String permissionType)
Check if the permission type is permitted in read only access mode
|
boolean |
permissionExists(SpacePermission permission)
Check whether the given SpacePermission exists.
|
void |
removeAllPermissions(Space space)
Deprecated.
|
void |
removeAllPermissions(Space space,
SpacePermissionContext context)
Removes all
SpacePermission's from the specified space. |
void |
removeAllPermissionsForGroup(String groupName)
Removes all the
SpacePermission's for the specified group. |
void |
removeAllPermissionsForGroup(String groupName,
SpacePermissionContext context)
Removes all permissions for the given group.
|
void |
removeAllUserPermissions(@NonNull ConfluenceUser user)
Removes all the
SpacePermission's for the specified user. |
void |
removeAllUserPermissions(ConfluenceUser user,
SpacePermissionContext context)
Removes all the
SpacePermission's for the specified user. |
void |
removeGlobalPermissionForUser(ConfluenceUser user,
String permissionType)
Removes the specified Global Permissions of type 'permissionType' from the user
|
void |
removeGlobalPermissionForUser(ConfluenceUser user,
String permissionType,
SpacePermissionContext context)
Removes the specified Global Permissions of type 'permissionType' from the user
|
void |
removePermission(SpacePermission permission)
Deprecated.
|
void |
removePermission(SpacePermission permission,
SpacePermissionContext context)
Removes the specified permission.
|
void |
savePermission(SpacePermission permission)
Deprecated.
|
void |
savePermission(SpacePermission permission,
SpacePermissionContext context)
Saves the permission.
|
void |
setGroupManager(com.atlassian.user.GroupManager groupManager) |
void |
setPermissionManager(PermissionManager permissionManager) |
void |
setSetSpacePermissionChecker(SetSpacePermissionChecker setSpacePermissionChecker) |
void |
setSpacePermissionManager(SpacePermissionManagerInternal spacePermissionManager) |
void |
setUserManager(com.atlassian.user.UserManager unused)
Deprecated.
since 7.7 unused
|
@Deprecated public void savePermission(SpacePermission permission)
savePermission in interface SpacePermissionSaverInsufficientPrivilegeException - if the current logged in user does not have sufficient permissions to do this. Check SetSpacePermissionChecker.canSetPermission(User, SpacePermission) first.public void savePermission(SpacePermission permission, SpacePermissionContext context)
SpacePermissionSaverInternal
May generate a SpacePermissionSaveEvent in the process,
depending on the context.
savePermission in interface SpacePermissionSaverInternalpermission - the permission to savecontext - the context for the save@Deprecated public void removeAllPermissions(Space space)
SpacePermission's from the specified space.removeAllPermissions in interface SpacePermissionManagerspace - The space to remove the permissions forInsufficientPrivilegeException - if the current logged in user does not have sufficient permissions to do this. Check Permission.SET_PERMISSIONS on PermissionManager first.public void removeAllPermissions(Space space, SpacePermissionContext context)
SpacePermission's from the specified space.removeAllPermissions in interface SpacePermissionManagerInternalspace - The space to remove the permissions forcontext - The context for this removalInsufficientPrivilegeException - if the current logged in user does not have sufficient permissions to do this. Check Permission.SET_PERMISSIONS on PermissionManager first.@Deprecated public void removePermission(SpacePermission permission)
removePermission in interface SpacePermissionManagerpermission - the permission to removeInsufficientPrivilegeException - if the current logged in user does not have sufficient permissions to do this. Check SetSpacePermissionChecker.canSetPermission(User, SpacePermission) first.public void removePermission(SpacePermission permission, SpacePermissionContext context)
removePermission in interface SpacePermissionManagerInternalpermission - the permission to removecontext - the context for the removalInsufficientPrivilegeException - if the current logged in user does not have sufficient permissions to do this. Check SetSpacePermissionChecker.canSetPermission(User, SpacePermission) first.public void createDefaultSpacePermissions(Space space)
createDefaultSpacePermissions in interface SpacePermissionManagerpublic void createPrivateSpacePermissions(Space space)
createPrivateSpacePermissions in interface SpacePermissionManagerpublic void removeAllUserPermissions(@NonNull ConfluenceUser user)
SpacePermission's for the specified user.removeAllUserPermissions in interface SpacePermissionManagerInsufficientPrivilegeException - if the current logged in user does not have sufficient permissions to do this. Check Permission.SET_PERMISSIONS using PermissionManager first.public void removeAllUserPermissions(ConfluenceUser user, SpacePermissionContext context)
SpacePermission's for the specified user.removeAllUserPermissions in interface SpacePermissionManagerInternaluser - the user to remove permissions forcontext - the context for the removalInsufficientPrivilegeException - if the current logged in user does not have sufficient permissions to do this. Check Permission.SET_PERMISSIONS using PermissionManager first.public void removeGlobalPermissionForUser(ConfluenceUser user, String permissionType)
removeGlobalPermissionForUser in interface SpacePermissionManageruser - the user to look uppermissionType - the permission type to removeInsufficientPrivilegeException - if the current logged in user does not have sufficient permissions to do this. Check Permission.SET_PERMISSIONS using PermissionManager first.public void removeGlobalPermissionForUser(ConfluenceUser user, String permissionType, SpacePermissionContext context)
removeGlobalPermissionForUser in interface SpacePermissionManagerInternaluser - the user to look uppermissionType - the permission type to removecontext - the context for the removalInsufficientPrivilegeException - if the current logged in user does not have sufficient permissions to do this. Check Permission.SET_PERMISSIONS using PermissionManager first.public void removeAllPermissionsForGroup(String groupName)
SpacePermission's for the specified group.removeAllPermissionsForGroup in interface SpacePermissionManagergroupName - the group to removeInsufficientPrivilegeException - if the current logged in user does not have sufficient permissions to do this. Check Permission.SET_PERMISSIONS using PermissionManager first.EntityRuntimeException - if there is an error retrieving the group with the specified group namepublic void removeAllPermissionsForGroup(String groupName, SpacePermissionContext context)
SpacePermissionManagerInternal
May generate a SpacePermissionsRemoveForGroupEvent in
the process, depending on the context.
removeAllPermissionsForGroup in interface SpacePermissionManagerInternalgroupName - the group to removepublic boolean hasPermission(String permissionType, @Nullable Space space, @Nullable com.atlassian.user.User remoteUser)
SpacePermissionManager
Unless you're writing code that is part of the permission checking implementation, or you're changing space permissions,
you should be using PermissionManager instead.
hasPermission in interface SpacePermissionManagerpermissionType - The permission type to look upspace - 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)public boolean hasPermissionNoExemptions(String permissionType, @Nullable Space space, @Nullable com.atlassian.user.User remoteUser)
SpacePermissionManagerSpacePermissionManager.hasPermission(String, Space, User) does.
For parameter and return value information, see SpacePermissionManager.hasPermission(String, Space, User).
hasPermissionNoExemptions in interface SpacePermissionManagerpublic boolean hasAllPermissions(List<String> permissionTypes, @Nullable Space space, @Nullable com.atlassian.user.User remoteUser)
SpacePermissionManagerIf 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 PermissionManager instead.
hasAllPermissions in interface SpacePermissionManagerpermissionTypes - A List of permission types (see SpacePermission) to checkspace - The space the permissions apply toremoteUser - The user to look uppublic List<SpacePermission> getAllPermissionsForGroup(String group)
getAllPermissionsForGroup in interface SpacePermissionManagerpublic List<SpacePermission> getGlobalPermissions()
getGlobalPermissions in interface SpacePermissionManagerpublic List<SpacePermission> getGlobalPermissions(String permissionType)
getGlobalPermissions in interface SpacePermissionManagerpublic void flushCaches()
flushCaches in interface SpacePermissionManagerpublic boolean groupHasPermission(String permissionType, @Nullable Space space, String group)
SpacePermissionManagerIf 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.
groupHasPermission in interface SpacePermissionManagerpermissionType - The permission type to look upspace - The space the permission applies to (can be null for global permissions)group - The group to look up the permission forpublic boolean hasPermissionForSpace(@Nullable com.atlassian.user.User user,
List permissionTypes,
@Nullable Space space)
hasPermissionForSpace in interface SpacePermissionManagerpublic Collection<com.atlassian.user.Group> getGroupsWithPermissions(@Nullable Space space)
SpacePermissionManagergetGroupsWithPermissions in interface SpacePermissionManagerspace - - space to query, if null global permissions returnedpublic Map<String,Long> getGroupsForPermissionType(String permissionType, Space space)
getGroupsForPermissionType in interface SpacePermissionManagerpublic Collection<com.atlassian.user.User> getUsersWithPermissions(@Nullable Space space)
SpacePermissionManagergetUsersWithPermissions in interface SpacePermissionManagerspace - - space to query, if null global permissions returnedpublic Map<String,Long> getUsersForPermissionType(String permissionType, Space space)
getUsersForPermissionType in interface SpacePermissionManagerpublic boolean permissionExists(SpacePermission permission)
SpacePermissionManagerpermissionExists in interface SpacePermissionManagerpermission - the permission to look for.public Set<SpacePermission> getDefaultGlobalPermissions()
SpacePermissionManagerBy default, confluence-administrators group has admin access, the default confluence users group can view the system and anonymous access is disabled.
getDefaultGlobalPermissions in interface SpacePermissionManagerSpacePermissions.public boolean isPermittedInReadOnlyAccessMode(String permissionType)
SpacePermissionManagerisPermittedInReadOnlyAccessMode in interface SpacePermissionManagerpermissionType - the permission type to be checkedpublic void setPermissionManager(PermissionManager permissionManager)
public void setSpacePermissionManager(SpacePermissionManagerInternal spacePermissionManager)
public void setSetSpacePermissionChecker(SetSpacePermissionChecker setSpacePermissionChecker)
@Deprecated public void setUserManager(com.atlassian.user.UserManager unused)
public void setGroupManager(com.atlassian.user.GroupManager groupManager)
Copyright © 2003–2022 Atlassian. All rights reserved.