Class CoarseGrainedCachingSpacePermissionManager
- All Implemented Interfaces:
SpacePermissionManagerInternal
,SpacePermissionSaverInternal
,DefaultConfluenceAccessManager.AccessManagerPermissionChecker
,SpacePermissionManager
,SpacePermissionSaver
- Direct Known Subclasses:
RecoveryAwareCGCachingSpacePermissionManager
Whenever there is a cache miss, all permissions for the current space (can be global) are fetched in one go and cached as one block. Entries can be primed before they are needed and the entries will never expire. Any permission changes will invalidate the cache entry for the affected space.
- Since:
- 5.9
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCoarseGrainedCachingSpacePermissionManager
(PermissionCheckExemptions permissionCheckExemptions, com.atlassian.cache.CacheFactory cacheFactory, SpacePermissionManagerInternal delegate, SpacePermissionDao spacePermissionDao, com.atlassian.event.api.EventPublisher eventPublisher, ConfluenceAccessManager confluenceAccessManager, SpacePermissionAccessMapper spacePermissionAccessMapper, com.atlassian.crowd.embedded.api.CrowdService crowdService, AccessModeManager accessModeManager, ScopesRequestCacheDelegate scopesRequestCacheDelegate, GlobalSettingsManager settingsManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
getAllPermissionsForGroup
(String group) getGlobalPermissions
(String permissionType) getGroupNamesWithPermission
(@Nullable Space targetSpace, String permissionType) 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.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
permissionExists
(SpacePermission permission) Check whether the given SpacePermission exists.void
void
removeAllPermissions
(Space space) Deprecated.since 5.9.void
removeAllPermissions
(Space space, SpacePermissionContext context) Removes all permissions belonging to spacevoid
Deprecated.since 5.8.void
removeAllPermissionsForGroup
(String group, SpacePermissionContext context) Removes all permissions for the given group.void
Deprecated.since 5.9.void
removeAllUserPermissions
(ConfluenceUser user, SpacePermissionContext context) Removes all permissions for the given user.void
removeGlobalPermissionForUser
(ConfluenceUser user, String permissionType) Deprecated.since 5.9.void
removeGlobalPermissionForUser
(ConfluenceUser user, String permissionType, SpacePermissionContext context) Removes global permission of specified type that is directly associated with a user.void
removePermission
(SpacePermission permission) Deprecated.since 5.9.void
removePermission
(SpacePermission permission, SpacePermissionContext context) Removes the given permission.void
savePermission
(SpacePermission permission) Deprecated.since 5.9.void
savePermission
(SpacePermission permission, SpacePermissionContext context) Saves the permission.Methods inherited from class com.atlassian.confluence.impl.security.AbstractSpacePermissionManager
getDefaultGlobalPermissions, groupHasPermission, hasAllPermissions, hasGlobalPermissionViaGroups, hasPermission, hasPermissionForSpace, hasPermissionNoExemptions, isPermittedInReadOnlyAccessMode
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.confluence.security.access.DefaultConfluenceAccessManager.AccessManagerPermissionChecker
hasGlobalPermissionViaGroups
Methods inherited from interface com.atlassian.confluence.security.SpacePermissionManager
getDefaultGlobalPermissions, groupHasPermission, hasAllPermissions, hasAllPermissions, hasPermission, hasPermission, hasPermissionForSpace, hasPermissionForSpace, hasPermissionNoExemptions, hasPermissionNoExemptions, isPermittedInReadOnlyAccessMode
-
Field Details
-
spacePermissionDao
-
-
Constructor Details
-
CoarseGrainedCachingSpacePermissionManager
public CoarseGrainedCachingSpacePermissionManager(PermissionCheckExemptions permissionCheckExemptions, com.atlassian.cache.CacheFactory cacheFactory, SpacePermissionManagerInternal delegate, SpacePermissionDao spacePermissionDao, com.atlassian.event.api.EventPublisher eventPublisher, ConfluenceAccessManager confluenceAccessManager, SpacePermissionAccessMapper spacePermissionAccessMapper, com.atlassian.crowd.embedded.api.CrowdService crowdService, AccessModeManager accessModeManager, ScopesRequestCacheDelegate scopesRequestCacheDelegate, GlobalSettingsManager settingsManager) - Since:
- 7.5
-
-
Method Details
-
removeAllPermissions
Deprecated.Description copied from interface:SpacePermissionManager
Removes all permissions belonging to space- Specified by:
removeAllPermissions
in interfaceSpacePermissionManager
- Parameters:
space
- The space to remove the permissions for
-
removeAllPermissions
Description copied from interface:SpacePermissionManagerInternal
Removes all permissions belonging to space- Specified by:
removeAllPermissions
in interfaceSpacePermissionManagerInternal
- Parameters:
space
- The space to remove the permissions forcontext
- The context for this removal
-
removePermission
Deprecated.Description copied from interface:SpacePermissionManager
Removes the given permission, and generates aSpacePermissionRemoveEvent
in the process.- Specified by:
removePermission
in interfaceSpacePermissionManager
- Parameters:
permission
- the permission to remove
-
removePermission
Description copied from interface:SpacePermissionManagerInternal
Removes the given permission.May generate a
SpacePermissionRemoveEvent
in the process, depending on the context.- Specified by:
removePermission
in interfaceSpacePermissionManagerInternal
- Parameters:
permission
- the permission to removecontext
- the context for the removal
-
removeAllUserPermissions
Deprecated.Description copied from interface:SpacePermissionManager
Removes all permissions for the given user, and generates aSpacePermissionsRemoveForUserEvent
in the process.- Specified by:
removeAllUserPermissions
in interfaceSpacePermissionManager
-
removeAllUserPermissions
Description copied from interface:SpacePermissionManagerInternal
Removes all permissions for the given user.May generate a
SpacePermissionsRemoveForUserEvent
in the process, depending on the context.- Specified by:
removeAllUserPermissions
in interfaceSpacePermissionManagerInternal
- Parameters:
user
- the user to remove permissions forcontext
- the context for the removal
-
removeGlobalPermissionForUser
Deprecated.Description copied from interface:SpacePermissionManager
Removes global permission of specified type that is directly associated with a user, and generates aSpacePermissionsRemoveForUserEvent
in the process.- Specified by:
removeGlobalPermissionForUser
in interfaceSpacePermissionManager
- Parameters:
user
- the user to look uppermissionType
- the permission type to remove
-
removeGlobalPermissionForUser
public void removeGlobalPermissionForUser(ConfluenceUser user, String permissionType, SpacePermissionContext context) Description copied from interface:SpacePermissionManagerInternal
Removes global permission of specified type that is directly associated with a user.May generate a
SpacePermissionsRemoveForUserEvent
in the process, depending on the context.- Specified by:
removeGlobalPermissionForUser
in interfaceSpacePermissionManagerInternal
- Parameters:
user
- the user to look uppermissionType
- the permission type to removecontext
- the context for the removal
-
removeAllPermissionsForGroup
Deprecated.Description copied from interface:SpacePermissionManager
Removes all permissions for the given group, and generates aSpacePermissionsRemoveForGroupEvent
in the process.- Specified by:
removeAllPermissionsForGroup
in interfaceSpacePermissionManager
- Parameters:
group
- the group to remove
-
removeAllPermissionsForGroup
Description copied from interface:SpacePermissionManagerInternal
Removes all permissions for the given group.May generate a
SpacePermissionsRemoveForGroupEvent
in the process, depending on the context.- Specified by:
removeAllPermissionsForGroup
in interfaceSpacePermissionManagerInternal
- Parameters:
group
- the group to remove
-
getAllPermissionsForGroup
- Specified by:
getAllPermissionsForGroup
in interfaceSpacePermissionManager
-
getGlobalPermissions
- Specified by:
getGlobalPermissions
in interfaceSpacePermissionManager
-
getGlobalPermissions
- Specified by:
getGlobalPermissions
in interfaceSpacePermissionManager
-
flushCaches
public void flushCaches()- Specified by:
flushCaches
in interfaceSpacePermissionManager
-
createDefaultSpacePermissions
- Specified by:
createDefaultSpacePermissions
in interfaceSpacePermissionManager
-
createPrivateSpacePermissions
- Specified by:
createPrivateSpacePermissions
in interfaceSpacePermissionManager
-
getGroupsWithPermissions
Description copied from interface:SpacePermissionManager
Returns 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:
getGroupsWithPermissions
in interfaceSpacePermissionManager
- Parameters:
space
- - space to query, if null global permissions returned- Returns:
- Collection of groups with permissions
-
getGroupsForPermissionType
- Specified by:
getGroupsForPermissionType
in interfaceSpacePermissionManager
-
getUsersWithPermissions
Description copied from interface:SpacePermissionManager
Returns 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:
getUsersWithPermissions
in interfaceSpacePermissionManager
- Parameters:
space
- - space to query, if null global permissions returned- Returns:
- Collection of User objects
-
getUsersForPermissionType
- Specified by:
getUsersForPermissionType
in interfaceSpacePermissionManager
-
getGroupNamesWithPermission
protected Iterable<String> getGroupNamesWithPermission(@Nullable Space targetSpace, String permissionType) - Specified by:
getGroupNamesWithPermission
in classAbstractSpacePermissionManager
-
permissionExists
Description copied from interface:SpacePermissionManager
Check whether the given SpacePermission exists. Checks by attribute equality rather than by id.- Specified by:
permissionExists
in interfaceDefaultConfluenceAccessManager.AccessManagerPermissionChecker
- Specified by:
permissionExists
in interfaceSpacePermissionManager
- Parameters:
permission
- the permission to look for.- Returns:
- true if the permission is recognised by the manager as existing.
-
savePermission
Deprecated.Description copied from interface:SpacePermissionSaver
Saves the permission, and generates aSpacePermissionSaveEvent
in the process.- Specified by:
savePermission
in interfaceSpacePermissionSaver
-
savePermission
Description copied from interface:SpacePermissionSaverInternal
Saves the permission.May generate a
SpacePermissionSaveEvent
in the process, depending on the context.- Specified by:
savePermission
in interfaceSpacePermissionSaverInternal
- Parameters:
permission
- the permission to savecontext
- the context for the save
-
prime
-