@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 |
createInitialSpacePermissions(Space space)
Creates initial space permissions for the specified 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(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(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
|
boolean |
hasAllPermissions(List<String> permissionTypes,
Space space,
com.atlassian.user.User remoteUser)
Determines if remoteUser has all of the given permissions in space
|
boolean |
hasPermission(List permissionTypes,
Space space,
com.atlassian.user.User remoteUser)
Determines if remoteUser has the given permissions in space
|
boolean |
hasPermission(String permissionType,
Space space,
com.atlassian.user.User remoteUser)
Determines if remoteUser has the given permission in space
|
boolean |
hasPermissionForSpace(com.atlassian.user.User user,
List permissionTypes,
Space space) |
boolean |
hasPermissionNoExemptions(String permissionType,
Space space,
com.atlassian.user.User remoteUser)
Returns true if the user has the specified permission on the target space.
|
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(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 |
removeAllUserPermissions(String username)
Deprecated.
|
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 userManager) |
@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 createInitialSpacePermissions(Space space)
createInitialSpacePermissions in interface SpacePermissionManagerInvalidOperationException - if you try to do this and you are not the creator of the specified space or not the system administrator.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.@Deprecated public void removeAllUserPermissions(@Nonnull String username)
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.EntityRuntimeException - if there is an error retrieving the user with the specified usernamepublic 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 hasPermission(List 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.
hasPermission in interface SpacePermissionManagerpermissionTypes - A List of permission types (see SpacePermission) to checkspace - The space the permissions apply toremoteUser - The user to look uppublic 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 void setPermissionManager(PermissionManager permissionManager)
public void setSpacePermissionManager(SpacePermissionManagerInternal spacePermissionManager)
public void setSetSpacePermissionChecker(SetSpacePermissionChecker setSpacePermissionChecker)
public void setUserManager(com.atlassian.user.UserManager userManager)
public void setGroupManager(com.atlassian.user.GroupManager groupManager)
Copyright © 2003–2018 Atlassian. All rights reserved.