|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.confluence.security.SpacePermissionCoordinator
public class SpacePermissionCoordinator
Space permission manager that adds a layer of security over the write operations in this class. That is, it performs
permission checking via the PermissionManager and SetSpacePermissionChecker before forwarding the call to the underlying space permission manager.
| Constructor Summary | |
|---|---|
SpacePermissionCoordinator()
|
|
| Method Summary | |
|---|---|
void |
createDefaultSpacePermissions(Space space)
|
void |
createInitialSpacePermissions(Space space)
Creates initial space permissions for the specified space. |
void |
createPrivateSpacePermissions(Space space)
|
void |
flushCaches()
|
java.util.List |
getAllPermissionsForGroup(java.lang.String group)
|
java.util.Set<SpacePermission> |
getDefaultGlobalPermissions()
Returns the default global permissions that are created when Confluence is set up. |
java.util.List |
getGlobalPermissions()
|
java.util.List |
getGlobalPermissions(java.lang.String permissionType)
|
java.util.Map |
getGroupsForPermissionType(java.lang.String permissionType,
Space space)
|
java.util.Collection |
getGroupsWithPermissions(Space space)
Returns all groups wich have permissions in a space or on a global level. |
java.util.Map |
getUsersForPermissionType(java.lang.String permissionType,
Space space)
|
java.util.Collection |
getUsersWithPermissions(Space space)
Returns a collection of user objects with VIEWSPACE_PERMISSION in the space. |
boolean |
groupHasPermission(java.lang.String permissionType,
Space space,
java.lang.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 |
hasAllPermissions(java.util.List<java.lang.String> permissionTypes,
Space space,
com.atlassian.user.User remoteUser)
Determines if remoteUser has all of the given permissions in space If remoteUser lacks any of the given permissions, false is returned. |
boolean |
hasPermission(java.util.List permissionTypes,
Space space,
com.atlassian.user.User remoteUser)
Determines if remoteUser has the given permissions in space If remoteUser lacks any of the given permissions, false is returned. |
boolean |
hasPermission(java.lang.String permissionType,
Space space,
com.atlassian.user.User remoteUser)
Determines if remoteUser has the given permission in space 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. |
boolean |
hasPermissionForSpace(com.atlassian.user.User user,
java.util.List permissionTypes,
Space space)
|
boolean |
permissionExists(SpacePermission permission)
Check whether the given SpacePermission exists. |
void |
removeAllPermissions(Space space)
Removes all SpacePermission's from the specified space. |
void |
removeAllPermissionsForGroup(java.lang.String groupName)
Removes all the SpacePermission's for the specified group. |
void |
removeAllUserPermissions(ConfluenceUser user)
Removes all the SpacePermission's for the specified user. |
void |
removeAllUserPermissions(java.lang.String username)
Deprecated. |
void |
removeGlobalPermissionForUser(ConfluenceUser user,
java.lang.String permissionType)
Removes the specified Global Permissions of type 'permissionType' from the user |
void |
removePermission(SpacePermission permission)
Removes the specified permission. |
void |
savePermission(SpacePermission permission)
Saves the specified permission. |
void |
setGroupManager(com.atlassian.user.GroupManager groupManager)
|
void |
setPermissionManager(PermissionManager permissionManager)
|
void |
setSetSpacePermissionChecker(SetSpacePermissionChecker setSpacePermissionChecker)
|
void |
setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
|
void |
setUserManager(com.atlassian.user.UserManager userManager)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SpacePermissionCoordinator()
| Method Detail |
|---|
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 removeAllPermissions(Space space)
SpacePermission's from the specified space.
removeAllPermissions in interface SpacePermissionManagerspace - The space to remove the permissions for
InsufficientPrivilegeException - if the current logged in user does not have sufficient permissions to do this. Check Permission.SET_PERMISSIONS on PermissionManager first.public void removePermission(SpacePermission permission)
removePermission in interface SpacePermissionManagerInsufficientPrivilegeException - 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(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.@Deprecated public void removeAllUserPermissions(java.lang.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 username
public void removeGlobalPermissionForUser(ConfluenceUser user,
java.lang.String permissionType)
removeGlobalPermissionForUser in interface SpacePermissionManageruser - the user to look uppermissionType - the permission type to remove
InsufficientPrivilegeException - 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 removeAllPermissionsForGroup(java.lang.String groupName)
SpacePermission's for the specified group.
removeAllPermissionsForGroup 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 group with the specified group name
public boolean hasPermission(java.lang.String permissionType,
Space space,
com.atlassian.user.User remoteUser)
SpacePermissionManagerPermissionManager 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 hasPermission(java.util.List permissionTypes,
Space space,
com.atlassian.user.User remoteUser)
SpacePermissionManagerPermissionManager instead.
hasPermission in interface SpacePermissionManagerpermissionTypes - A List of permission types (see SpacePermission) to checkspace - The space the permissions apply toremoteUser - The user to look up
public boolean hasAllPermissions(java.util.List<java.lang.String> permissionTypes,
Space space,
com.atlassian.user.User remoteUser)
SpacePermissionManagerPermissionManager instead.
hasAllPermissions in interface SpacePermissionManagerpermissionTypes - A List of permission types (see SpacePermission) to checkspace - The space the permissions apply to
public java.util.List getAllPermissionsForGroup(java.lang.String group)
getAllPermissionsForGroup in interface SpacePermissionManagerpublic java.util.List getGlobalPermissions()
getGlobalPermissions in interface SpacePermissionManagerpublic java.util.List getGlobalPermissions(java.lang.String permissionType)
getGlobalPermissions in interface SpacePermissionManagerpublic void flushCaches()
flushCaches in interface SpacePermissionManager
public boolean groupHasPermission(java.lang.String permissionType,
Space space,
java.lang.String group)
SpacePermissionManager
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 for
public boolean hasPermissionForSpace(com.atlassian.user.User user,
java.util.List permissionTypes,
Space space)
hasPermissionForSpace in interface SpacePermissionManagerpublic java.util.Collection getGroupsWithPermissions(Space space)
SpacePermissionManager
getGroupsWithPermissions in interface SpacePermissionManagerspace - - space to query, if null global permissions returned
public java.util.Map getGroupsForPermissionType(java.lang.String permissionType,
Space space)
getGroupsForPermissionType in interface SpacePermissionManagerpublic java.util.Collection getUsersWithPermissions(Space space)
SpacePermissionManager
getUsersWithPermissions in interface SpacePermissionManagerspace - - space to query, if null global permissions returned
public java.util.Map getUsersForPermissionType(java.lang.String permissionType,
Space space)
getUsersForPermissionType in interface SpacePermissionManagerpublic boolean permissionExists(SpacePermission permission)
SpacePermissionManager
permissionExists in interface SpacePermissionManagerpermission - the permission to look for.
public java.util.Set<SpacePermission> getDefaultGlobalPermissions()
SpacePermissionManager
getDefaultGlobalPermissions in interface SpacePermissionManagerSpacePermissions.public void setPermissionManager(PermissionManager permissionManager)
public void setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
public void setSetSpacePermissionChecker(SetSpacePermissionChecker setSpacePermissionChecker)
public void setUserManager(com.atlassian.user.UserManager userManager)
public void setGroupManager(com.atlassian.user.GroupManager groupManager)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||