public class DefaultSpacePermissionManager extends AbstractSpacePermissionManager
spacePermissionDao
Modifier | Constructor and Description |
---|---|
protected |
DefaultSpacePermissionManager(SpacePermissionDao spacePermissionDao,
PermissionCheckExemptions permissionCheckExemptions,
SpacePermissionDefaultsStoreFactory spacePermissionDefaultsStoreFactory) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canUseConfluence(com.atlassian.user.User remoteUser,
String permissionCheck) |
void |
createDefaultSpacePermissions(Space space) |
void |
createInitialSpacePermissions(Space space)
Deprecated, make it private later
|
void |
createPrivateSpacePermissions(Space space) |
void |
flushCaches() |
List |
getAllPermissionsForGroup(String group) |
protected List<SpacePermission> |
getAllPermissionsForUser(ConfluenceUser user) |
List |
getGlobalPermissions() |
List |
getGlobalPermissions(String permissionType) |
protected Set<String> |
getGroupNamesWithPermission(Space targetSpace,
String permissionType) |
Map |
getGroupsForPermissionType(String permissionType,
Space space) |
Collection |
getGroupsWithPermissions(Space space)
Returns all groups which have permissions in a space or on a global level.
|
Map |
getUsersForPermissionType(String permissionType,
Space space) |
Collection |
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
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(List<String> permissionTypes,
Space space,
com.atlassian.user.User user)
Determines if remoteUser has all of the given permissions in space
If remoteUser lacks any of the given permissions, false is returned.
|
boolean |
hasPermission(List permissionTypes,
Space space,
com.atlassian.user.User user)
Deprecated.
|
boolean |
hasPermission(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 |
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)
Determines if permission exists in the SpacePermissionDao
|
void |
removeAllPermissions(Space space)
Removes all permissions belonging to space
|
void |
removeAllPermissionsForGroup(String group) |
void |
removeAllUserPermissions(ConfluenceUser user) |
void |
removeAllUserPermissions(String username)
Deprecated.
|
void |
removeGlobalPermissionForUser(ConfluenceUser user,
String permissionType)
Removes global permission of specified type that is directly associated with a user
|
void |
removePermission(SpacePermission permission)
Removes the specified permission.
|
protected void |
removePermissionFromDao(SpacePermission realPermission)
Removes the permission from the data store
This may be overridden to provide caching, where applicable
|
protected void |
removePermissions(List permissions) |
void |
savePermission(SpacePermission permission)
Saves the permission.
|
protected void |
savePermissionToDao(SpacePermission permission)
Saves the permission to the data store
This may be overridden to provide caching, where applicable.
|
getDefaultGlobalPermissions, getUserAccessor, hasPermissionForSpace
protected DefaultSpacePermissionManager(SpacePermissionDao spacePermissionDao, PermissionCheckExemptions permissionCheckExemptions, SpacePermissionDefaultsStoreFactory spacePermissionDefaultsStoreFactory)
public void flushCaches()
public void savePermission(SpacePermission permission)
SpacePermissionSaver
IllegalArgumentException
- if the permission is a disallowed anonymous permission (CONF-4155)public void removePermission(SpacePermission permission)
public boolean hasPermission(String permissionType, Space space, com.atlassian.user.User remoteUser)
SpacePermissionManager
PermissionManager
instead.permissionType
- 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, Space space, com.atlassian.user.User remoteUser)
SpacePermissionManager
SpacePermissionManager.hasPermission(String, Space, User)
does.
For parameter and return value information, see SpacePermissionManager.hasPermission(String, Space, User)
.protected boolean canUseConfluence(com.atlassian.user.User remoteUser, String permissionCheck)
public boolean hasPermission(List permissionTypes, Space space, com.atlassian.user.User user)
hasAllPermissions(java.util.List, com.atlassian.confluence.spaces.Space, com.atlassian.user.User)
SpacePermissionManager
PermissionManager
instead.permissionTypes
- A List of permission types (see SpacePermission) to checkspace
- The space the permissions apply touser
- The user to look uppublic boolean hasAllPermissions(List<String> permissionTypes, Space space, com.atlassian.user.User user)
SpacePermissionManager
PermissionManager
instead.permissionTypes
- A List of permission types (see SpacePermission) to checkspace
- The space the permissions apply topublic boolean groupHasPermission(String permissionType, Space space, String group)
SpacePermissionManager
permissionType
- 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 List getGlobalPermissions()
public void removeAllUserPermissions(ConfluenceUser user)
@Deprecated public void removeAllUserPermissions(String username)
username
- the username of the user whose permissions are being removed.public void removeGlobalPermissionForUser(ConfluenceUser user, String permissionType)
SpacePermissionManager
user
- the user to look uppermissionType
- the permission type to removepublic void removeAllPermissionsForGroup(String group)
protected void removePermissions(List permissions)
protected List<SpacePermission> getAllPermissionsForUser(ConfluenceUser user)
public void removeAllPermissions(Space space)
SpacePermissionManager
space
- The space to remove the permissions forpublic void createInitialSpacePermissions(Space space)
space
- public void createPrivateSpacePermissions(Space space)
public void createDefaultSpacePermissions(Space space)
public Collection getUsersWithPermissions(Space space)
SpacePermissionManager
space
- - space to query, if null global permissions returnedpublic Collection getGroupsWithPermissions(Space space)
SpacePermissionManager
space
- - space to query, if null global permissions returnedpublic Map getGroupsForPermissionType(String permissionType, Space space)
permissionType
- space
- String
groupNames and values that are Long
Group
permissionId. The keys in the Map are not case sensitive.protected Set<String> getGroupNamesWithPermission(Space targetSpace, String permissionType)
public boolean permissionExists(SpacePermission permission)
permission
- The SpacePermission object to look upprotected void savePermissionToDao(SpacePermission permission)
permission
- the SpacePermission to be savedprotected void removePermissionFromDao(SpacePermission realPermission)
realPermission
- the SpacePermission to be removedCopyright © 2003–2015 Atlassian. All rights reserved.