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 |
confluenceAccessManager, permissionCheckExemptions, spacePermissionAccessMapper
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,
com.atlassian.util.concurrent.Supplier<UserAccessor> userAccessor,
AccessModeManager accessModeManager) |
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.
|
getAccessModeManager, getDefaultGlobalPermissions, getUserAccessor, groupHasPermission, hasAllPermissions, hasGlobalPermissionViaGroups, hasPermission, hasPermissionForSpace, hasPermissionNoExemptions, isPermittedInReadOnlyAccessMode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDefaultGlobalPermissions, groupHasPermission, hasAllPermissions, hasPermission, hasPermissionForSpace, hasPermissionNoExemptions, isPermittedInReadOnlyAccessMode
protected 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, com.atlassian.util.concurrent.Supplier<UserAccessor> userAccessor, AccessModeManager accessModeManager)
@Deprecated public void removeAllPermissions(Space space)
SpacePermissionManagerInternal.removeAllPermissions(com.atlassian.confluence.spaces.Space, com.atlassian.confluence.internal.security.SpacePermissionContext)
instead.SpacePermissionManager
removeAllPermissions
in interface SpacePermissionManager
space
- The space to remove the permissions forpublic void removeAllPermissions(Space space, SpacePermissionContext context)
SpacePermissionManagerInternal
removeAllPermissions
in interface SpacePermissionManagerInternal
space
- 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.SpacePermissionManager
SpacePermissionRemoveEvent
in the process.removePermission
in interface SpacePermissionManager
permission
- 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 SpacePermissionManagerInternal
permission
- 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.SpacePermissionManager
SpacePermissionsRemoveForUserEvent
in the process.removeAllUserPermissions
in interface SpacePermissionManager
public void removeAllUserPermissions(ConfluenceUser user, SpacePermissionContext context)
SpacePermissionManagerInternal
May generate a SpacePermissionsRemoveForUserEvent
in the
process, depending on the context.
removeAllUserPermissions
in interface SpacePermissionManagerInternal
user
- 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.SpacePermissionManager
SpacePermissionsRemoveForUserEvent
in the process.removeGlobalPermissionForUser
in interface SpacePermissionManager
user
- 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 SpacePermissionManagerInternal
user
- 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.SpacePermissionManager
SpacePermissionsRemoveForGroupEvent
in the process.removeAllPermissionsForGroup
in interface SpacePermissionManager
group
- 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 SpacePermissionManagerInternal
group
- the group to removepublic List<SpacePermission> getAllPermissionsForGroup(String group)
getAllPermissionsForGroup
in interface SpacePermissionManager
public List<SpacePermission> getGlobalPermissions()
getGlobalPermissions
in interface SpacePermissionManager
public List<SpacePermission> getGlobalPermissions(String permissionType)
getGlobalPermissions
in interface SpacePermissionManager
public void flushCaches()
flushCaches
in interface SpacePermissionManager
public void createDefaultSpacePermissions(Space space)
createDefaultSpacePermissions
in interface SpacePermissionManager
public void createPrivateSpacePermissions(Space space)
createPrivateSpacePermissions
in interface SpacePermissionManager
public Collection<com.atlassian.user.Group> getGroupsWithPermissions(@Nullable Space space)
SpacePermissionManager
getGroupsWithPermissions
in interface SpacePermissionManager
space
- - space to query, if null global permissions returnedpublic Map<String,Long> getGroupsForPermissionType(String permissionType, Space space)
getGroupsForPermissionType
in interface SpacePermissionManager
public Collection<com.atlassian.user.User> getUsersWithPermissions(@Nullable Space space)
SpacePermissionManager
getUsersWithPermissions
in interface SpacePermissionManager
space
- - space to query, if null global permissions returnedpublic Map<String,Long> getUsersForPermissionType(String permissionType, Space space)
getUsersForPermissionType
in interface SpacePermissionManager
protected Iterable<String> getGroupNamesWithPermission(@Nullable Space targetSpace, String permissionType)
getGroupNamesWithPermission
in class AbstractSpacePermissionManager
public boolean permissionExists(SpacePermission permission)
SpacePermissionManager
permissionExists
in interface DefaultConfluenceAccessManager.AccessManagerPermissionChecker
permissionExists
in interface SpacePermissionManager
permission
- the permission to look for.@Deprecated public void savePermission(SpacePermission permission)
SpacePermissionSaverInternal.savePermission(SpacePermission, com.atlassian.confluence.internal.security.SpacePermissionContext)
instead.SpacePermissionSaver
SpacePermissionSaveEvent
in the process.savePermission
in interface SpacePermissionSaver
public void savePermission(SpacePermission permission, SpacePermissionContext context)
SpacePermissionSaverInternal
May generate a SpacePermissionSaveEvent
in the process,
depending on the context.
savePermission
in interface SpacePermissionSaverInternal
permission
- the permission to savecontext
- the context for the saveCopyright © 2003–2021 Atlassian. All rights reserved.