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
FieldsModifier and TypeFieldDescriptionprotected final SpacePermissionDaoDeprecated, for removal: This API element is subject to removal in a future version. -
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, GlobalSettingsManager settingsManager) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated, for removal: This API element is subject to removal in a future version.voidDeprecated, for removal: This API element is subject to removal in a future version.voidDeprecated, for removal: This API element is subject to removal in a future version.getAllPermissionsForGroup(String group) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.getGlobalPermissions(String permissionType) Deprecated, for removal: This API element is subject to removal in a future version.getGroupNamesWithPermission(@Nullable Space targetSpace, String permissionType) Deprecated, for removal: This API element is subject to removal in a future version.getGroupsForPermissionType(String permissionType, Space space) Deprecated, for removal: This API element is subject to removal in a future version.Collection<com.atlassian.user.Group> getGroupsWithPermissions(@Nullable Space space) Deprecated, for removal: This API element is subject to removal in a future version.Returns all groups which have permissions in a space or on a global level.Deprecated, for removal: This API element is subject to removal in a future version.Get all permissions granted to the anonymous users in the given spacegetPermissionsForGroup(String group, Space space) Deprecated, for removal: This API element is subject to removal in a future version.Get all permissions for the given group in the specified spacegetPermissionsForUser(ConfluenceUser user, Space space) Deprecated, for removal: This API element is subject to removal in a future version.Get all permissions for the given user in the specified spacegetUsersForPermissionType(String permissionType, Space space) Deprecated, for removal: This API element is subject to removal in a future version.getUsersWithPermissions(@Nullable Space space) Deprecated, for removal: This API element is subject to removal in a future version.Returns a collection of user objects with VIEWSPACE_PERMISSION in the space.booleanpermissionExists(SpacePermission permission) Deprecated, for removal: This API element is subject to removal in a future version.Check whether the given SpacePermission exists.voidDeprecated, for removal: This API element is subject to removal in a future version.voidremoveAllPermissions(Space space) Deprecated.since 5.9.voidremoveAllPermissions(Space space, SpacePermissionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Removes all permissions belonging to spacevoidDeprecated.since 5.8.voidremoveAllPermissionsForGroup(String group, SpacePermissionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Removes all permissions for the given group.voidDeprecated.since 5.9.voidremoveAllUserPermissions(ConfluenceUser user, SpacePermissionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Removes all permissions for the given user.voidremoveGlobalPermissionForUser(ConfluenceUser user, String permissionType) Deprecated.since 5.9.voidremoveGlobalPermissionForUser(ConfluenceUser user, String permissionType, SpacePermissionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Removes global permission of specified type that is directly associated with a user.voidremovePermission(SpacePermission permission) Deprecated.since 5.9.voidremovePermission(SpacePermission permission, SpacePermissionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Removes the given permission.voidremovePermissions(Collection<SpacePermission> permissionsToRemove, SpacePermissionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Removes the given permissions.voidsaveGlobalPermissions(Collection<SpacePermission> spacePermissions, SpacePermissionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Adds global permissionsvoidsavePermission(SpacePermission permission) Deprecated.since 5.9.voidsavePermission(SpacePermission permission, SpacePermissionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Saves the permission.voidsaveSpacePermissions(Space space, Collection<SpacePermission> spacePermissions, SpacePermissionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Adds space permissions to the spaceMethods inherited from class com.atlassian.confluence.impl.security.AbstractSpacePermissionManager
getDefaultGlobalPermissions, groupHasPermission, hasAllPermissions, hasGlobalPermissionViaGroups, hasPermission, hasPermissionForSpace, hasPermissionNoExemptions, isPermittedInReadOnlyAccessModeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.confluence.security.SpacePermissionManager
getDefaultGlobalPermissions, groupHasPermission, hasAllPermissions, hasPermission, hasPermissionForSpace, hasPermissionNoExemptions, isPermittedInReadOnlyAccessMode
-
Field Details
-
spacePermissionDao
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
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, GlobalSettingsManager settingsManager) Deprecated, for removal: This API element is subject to removal in a future version.- Since:
- 7.5
-
-
Method Details
-
removeAllPermissions
Deprecated.Description copied from interface:SpacePermissionManagerRemoves all permissions belonging to space- Specified by:
removeAllPermissionsin interfaceSpacePermissionManager- Parameters:
space- The space to remove the permissions for
-
removeAllPermissions
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SpacePermissionManagerInternalRemoves all permissions belonging to space- Specified by:
removeAllPermissionsin interfaceSpacePermissionManagerInternal- Parameters:
space- The space to remove the permissions forcontext- The context for this removal
-
removePermission
Deprecated.Description copied from interface:SpacePermissionManagerRemoves the given permission, and generates aSpacePermissionRemoveEventin the process.- Specified by:
removePermissionin interfaceSpacePermissionManager- Parameters:
permission- the permission to remove
-
removePermission
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SpacePermissionManagerInternalRemoves the given permission.May generate a
SpacePermissionRemoveEventin the process, depending on the context.- Specified by:
removePermissionin interfaceSpacePermissionManagerInternal- Parameters:
permission- the permission to removecontext- the context for the removal
-
removeAllUserPermissions
Deprecated.Description copied from interface:SpacePermissionManagerRemoves all permissions for the given user, and generates aSpacePermissionsRemoveForUserEventin the process.- Specified by:
removeAllUserPermissionsin interfaceSpacePermissionManager
-
removeAllUserPermissions
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SpacePermissionManagerInternalRemoves all permissions for the given user.May generate a
SpacePermissionsRemoveForUserEventin the process, depending on the context.- Specified by:
removeAllUserPermissionsin interfaceSpacePermissionManagerInternal- Parameters:
user- the user to remove permissions forcontext- the context for the removal
-
removePermissions
public void removePermissions(Collection<SpacePermission> permissionsToRemove, SpacePermissionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SpacePermissionManagerInternalRemoves the given permissions.May generate a
SpacePermissionRemoveEventin the process, depending on the context.- Specified by:
removePermissionsin interfaceSpacePermissionManagerInternal- Parameters:
permissionsToRemove- the permissions to removecontext- the context for the removal
-
removeGlobalPermissionForUser
Deprecated.Description copied from interface:SpacePermissionManagerRemoves global permission of specified type that is directly associated with a user, and generates aSpacePermissionsRemoveForUserEventin the process.- Specified by:
removeGlobalPermissionForUserin interfaceSpacePermissionManager- Parameters:
user- the user to look uppermissionType- the permission type to remove
-
removeGlobalPermissionForUser
public void removeGlobalPermissionForUser(ConfluenceUser user, String permissionType, SpacePermissionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SpacePermissionManagerInternalRemoves global permission of specified type that is directly associated with a user.May generate a
SpacePermissionsRemoveForUserEventin the process, depending on the context.- Specified by:
removeGlobalPermissionForUserin interfaceSpacePermissionManagerInternal- Parameters:
user- the user to look uppermissionType- the permission type to removecontext- the context for the removal
-
removeAllPermissionsForGroup
Deprecated.Description copied from interface:SpacePermissionManagerRemoves all permissions for the given group, and generates aSpacePermissionsRemoveForGroupEventin the process.- Specified by:
removeAllPermissionsForGroupin interfaceSpacePermissionManager- Parameters:
group- the group to remove
-
removeAllPermissionsForGroup
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SpacePermissionManagerInternalRemoves all permissions for the given group.May generate a
SpacePermissionsRemoveForGroupEventin the process, depending on the context.- Specified by:
removeAllPermissionsForGroupin interfaceSpacePermissionManagerInternal- Parameters:
group- the group to remove
-
getPermissionsForGroup
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SpacePermissionManagerGet all permissions for the given group in the specified space- Specified by:
getPermissionsForGroupin interfaceSpacePermissionManager- Parameters:
group- the name of the groupspace- the space entity- Returns:
- a list of space permissions granted to the group in the given space
-
getPermissionsForUser
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SpacePermissionManagerGet all permissions for the given user in the specified space- Specified by:
getPermissionsForUserin interfaceSpacePermissionManager- Parameters:
user- the user to look upspace- the space entity- Returns:
- a list of space permissions granted to the user in the given space
-
getPermissionsForAnonymousUsers
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SpacePermissionManagerGet all permissions granted to the anonymous users in the given space- Specified by:
getPermissionsForAnonymousUsersin interfaceSpacePermissionManager- Parameters:
space- the space entity- Returns:
- a list of space permissions granted to anonymous users in the given space
-
getAllPermissionsForGroup
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getAllPermissionsForGroupin interfaceSpacePermissionManager
-
getGlobalPermissions
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getGlobalPermissionsin interfaceSpacePermissionManager
-
getGlobalPermissions
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getGlobalPermissionsin interfaceSpacePermissionManager
-
flushCaches
public void flushCaches()Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
flushCachesin interfaceSpacePermissionManager
-
createDefaultSpacePermissions
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
createDefaultSpacePermissionsin interfaceSpacePermissionManager
-
createPrivateSpacePermissions
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
createPrivateSpacePermissionsin interfaceSpacePermissionManager
-
getGroupsWithPermissions
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SpacePermissionManagerReturns 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:
getGroupsWithPermissionsin interfaceSpacePermissionManager- Parameters:
space- - space to query, if null global permissions returned- Returns:
- Collection of groups with permissions
-
getGroupsForPermissionType
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getGroupsForPermissionTypein interfaceSpacePermissionManager
-
getUsersWithPermissions
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SpacePermissionManagerReturns 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:
getUsersWithPermissionsin interfaceSpacePermissionManager- Parameters:
space- - space to query, if null global permissions returned- Returns:
- Collection of User objects
-
getUsersForPermissionType
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getUsersForPermissionTypein interfaceSpacePermissionManager
-
getGroupNamesWithPermission
protected Iterable<String> getGroupNamesWithPermission(@Nullable Space targetSpace, String permissionType) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getGroupNamesWithPermissionin classAbstractSpacePermissionManager
-
permissionExists
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SpacePermissionManagerCheck whether the given SpacePermission exists. Checks by attribute equality rather than by id.- Specified by:
permissionExistsin interfaceDefaultConfluenceAccessManager.AccessManagerPermissionChecker- Specified by:
permissionExistsin 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:SpacePermissionSaverSaves the permission, and generates aSpacePermissionSaveEventin the process.- Specified by:
savePermissionin interfaceSpacePermissionSaver
-
savePermission
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SpacePermissionSaverInternalSaves the permission.May generate a
SpacePermissionSaveEventin the process, depending on the context.- Specified by:
savePermissionin interfaceSpacePermissionSaverInternal- Parameters:
permission- the permission to savecontext- the context for the save
-
saveSpacePermissions
public void saveSpacePermissions(Space space, Collection<SpacePermission> spacePermissions, SpacePermissionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SpacePermissionSaverInternalAdds space permissions to the space- Specified by:
saveSpacePermissionsin interfaceSpacePermissionSaverInternal- Parameters:
space- Space to which permissions should be grantedspacePermissions- Collection of space permissions. They should all belong to the same space.context- the context of the save
-
prime
Deprecated, for removal: This API element is subject to removal in a future version. -
saveGlobalPermissions
public void saveGlobalPermissions(Collection<SpacePermission> spacePermissions, SpacePermissionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:SpacePermissionSaverInternalAdds global permissions- Specified by:
saveGlobalPermissionsin interfaceSpacePermissionSaverInternal- Parameters:
spacePermissions- Collection of global permissions.context- the context of the save
-
CachingSpacePermissionManagerinstead.