public class CoarseGrainedCachingSpacePermissionManager extends AbstractSpacePermissionManager
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.
SpacePermissionCachePrimer| Modifier and Type | Field and Description |
|---|---|
protected SpacePermissionDao |
spacePermissionDao |
| Constructor and Description |
|---|
CoarseGrainedCachingSpacePermissionManager(PermissionCheckExemptions permissionCheckExemptions,
com.atlassian.vcache.VCacheFactory 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) |
| Modifier and Type | Method and Description |
|---|---|
void |
createDefaultSpacePermissions(Space space) |
void |
createPrivateSpacePermissions(Space space) |
void |
flushCaches() |
List<SpacePermission> |
getAllPermissionsForGroup(String group) |
List<SpacePermission> |
getGlobalPermissions() |
List<SpacePermission> |
getGlobalPermissions(String permissionType) |
protected Iterable<String> |
getGroupNamesWithPermission(@Nullable Space targetSpace,
String permissionType) |
Map<String,Long> |
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.
|
Map<String,Long> |
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 |
prime(Iterable<? extends Space> spaces)
Pre-loads global permissions and permissions for given spaces.
|
void |
removeAllPermissions(Space space)
|
void |
removeAllPermissions(Space space,
SpacePermissionContext context)
Removes all permissions belonging to space
|
void |
removeAllPermissionsForGroup(String group)
Deprecated.
|
void |
removeAllPermissionsForGroup(String group,
SpacePermissionContext context)
Removes all permissions for the given group.
|
void |
removeAllUserPermissions(ConfluenceUser user)
|
void |
removeAllUserPermissions(ConfluenceUser user,
SpacePermissionContext context)
Removes all permissions for the given user.
|
void |
removeGlobalPermissionForUser(ConfluenceUser user,
String permissionType)
|
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.
|
void |
removePermission(SpacePermission permission,
SpacePermissionContext context)
Removes the given permission.
|
void |
savePermission(SpacePermission permission)
Deprecated.
|
void |
savePermission(SpacePermission permission,
SpacePermissionContext context)
Saves the permission.
|
getDefaultGlobalPermissions, groupHasPermission, hasAllPermissions, hasGlobalPermissionViaGroups, hasPermission, hasPermissionForSpace, hasPermissionNoExemptions, isPermittedInReadOnlyAccessModeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDefaultGlobalPermissions, groupHasPermission, hasAllPermissions, hasPermission, hasPermissionForSpace, hasPermissionNoExemptions, isPermittedInReadOnlyAccessModeprotected final SpacePermissionDao spacePermissionDao
public CoarseGrainedCachingSpacePermissionManager(PermissionCheckExemptions permissionCheckExemptions, com.atlassian.vcache.VCacheFactory 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)
@Deprecated public void removeAllPermissions(Space space)
SpacePermissionManagerInternal.removeAllPermissions(com.atlassian.confluence.spaces.Space, com.atlassian.confluence.internal.security.SpacePermissionContext) instead.SpacePermissionManagerremoveAllPermissions in interface SpacePermissionManagerspace - The space to remove the permissions forpublic void removeAllPermissions(Space space, SpacePermissionContext context)
SpacePermissionManagerInternalremoveAllPermissions in interface SpacePermissionManagerInternalspace - The space to remove the permissions forcontext - The context for this removal@Deprecated public void removePermission(SpacePermission permission)
SpacePermissionManagerInternal.removePermission(SpacePermission, com.atlassian.confluence.internal.security.SpacePermissionContext) instead.SpacePermissionManagerSpacePermissionRemoveEvent in the process.removePermission in interface SpacePermissionManagerpermission - the permission to removepublic void removePermission(SpacePermission permission, SpacePermissionContext context)
SpacePermissionManagerInternal
May generate a SpacePermissionRemoveEvent in the process,
depending on the context.
removePermission in interface SpacePermissionManagerInternalpermission - the permission to removecontext - the context for the removal@Deprecated public void removeAllUserPermissions(ConfluenceUser user)
SpacePermissionManagerInternal.removeAllUserPermissions(com.atlassian.confluence.user.ConfluenceUser, com.atlassian.confluence.internal.security.SpacePermissionContext) instead.SpacePermissionManagerSpacePermissionsRemoveForUserEvent in the process.removeAllUserPermissions in interface SpacePermissionManagerpublic void removeAllUserPermissions(ConfluenceUser user, SpacePermissionContext context)
SpacePermissionManagerInternal
May generate a SpacePermissionsRemoveForUserEvent in the
process, depending on the context.
removeAllUserPermissions in interface SpacePermissionManagerInternaluser - the user to remove permissions forcontext - the context for the removal@Deprecated public void removeGlobalPermissionForUser(ConfluenceUser user, String permissionType)
SpacePermissionManagerInternal.removeGlobalPermissionForUser(com.atlassian.confluence.user.ConfluenceUser, String, com.atlassian.confluence.internal.security.SpacePermissionContext) instead.SpacePermissionManagerSpacePermissionsRemoveForUserEvent in the process.removeGlobalPermissionForUser in interface SpacePermissionManageruser - the user to look uppermissionType - the permission type to removepublic void removeGlobalPermissionForUser(ConfluenceUser user, String permissionType, SpacePermissionContext context)
SpacePermissionManagerInternal
May generate a SpacePermissionsRemoveForUserEvent in the
process, depending on the context.
removeGlobalPermissionForUser in interface SpacePermissionManagerInternaluser - the user to look uppermissionType - the permission type to removecontext - the context for the removal@Deprecated public void removeAllPermissionsForGroup(String group)
SpacePermissionManagerInternal.removeAllPermissionsForGroup(String, com.atlassian.confluence.internal.security.SpacePermissionContext) instead.SpacePermissionManagerSpacePermissionsRemoveForGroupEvent in the process.removeAllPermissionsForGroup in interface SpacePermissionManagergroup - the group to removepublic void removeAllPermissionsForGroup(String group, SpacePermissionContext context)
SpacePermissionManagerInternal
May generate a SpacePermissionsRemoveForGroupEvent in
the process, depending on the context.
removeAllPermissionsForGroup in interface SpacePermissionManagerInternalgroup - the group to removepublic 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 void createDefaultSpacePermissions(Space space)
createDefaultSpacePermissions in interface SpacePermissionManagerpublic void createPrivateSpacePermissions(Space space)
createPrivateSpacePermissions 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 SpacePermissionManagerprotected Iterable<String> getGroupNamesWithPermission(@Nullable Space targetSpace, String permissionType)
getGroupNamesWithPermission in class AbstractSpacePermissionManagerpublic boolean permissionExists(SpacePermission permission)
SpacePermissionManagerpermissionExists in interface DefaultConfluenceAccessManager.AccessManagerPermissionCheckerpermissionExists in interface SpacePermissionManagerpermission - the permission to look for.@Deprecated public void savePermission(SpacePermission permission)
SpacePermissionSaverInternal.savePermission(SpacePermission, com.atlassian.confluence.internal.security.SpacePermissionContext) instead.SpacePermissionSaverSpacePermissionSaveEvent in the process.savePermission in interface SpacePermissionSaverpublic 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 saveCopyright © 2003–2022 Atlassian. All rights reserved.