@Internal @ParametersAreNonnullByDefault public class CachingSpacePermissionManager extends DefaultSpacePermissionManager
Modifier and Type | Field and Description |
---|---|
static String |
CACHE_KEY |
spacePermissionDao
confluenceAccessManager, permissionCheckExemptions, spacePermissionAccessMapper
Constructor and Description |
---|
CachingSpacePermissionManager(SpacePermissionDao spacePermissionDao,
PermissionCheckExemptions permissionCheckExemptions,
SpacePermissionDefaultsStoreFactory spacePermissionDefaultsStoreFactory,
com.atlassian.cache.CacheFactory cacheFactory,
com.atlassian.event.api.EventPublisher eventPublisher,
ConfluenceAccessManager confluenceAccessManager,
SpacePermissionAccessMapper spacePermissionAccessMapper,
com.atlassian.crowd.embedded.api.CrowdService crowdService,
com.google.common.base.Supplier<UserAccessor> userAccessor) |
Modifier and Type | Method and Description |
---|---|
void |
flushCaches() |
protected Set<String> |
getGroupNamesWithPermission(Space targetSpace,
String permissionType) |
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 |
isLookAheadEnabled() |
boolean |
permissionExists(SpacePermission permission)
Looks up permission in the cache instance.
|
protected void |
removeAllPermissionsFromDao(Space space) |
protected void |
removePermissionFromDao(SpacePermission spacePermission)
Removes realPermission from the DAO.
|
protected void |
savePermissionToDao(SpacePermission spacePermission)
Saves permission to the DAO.
|
void |
setLookAheadEnabled(boolean lookAheadEnabled) |
createDefaultSpacePermissions, createInitialSpacePermissions, createPrivateSpacePermissions, getAllPermissionsForGroup, getAllPermissionsForUser, getGlobalPermissions, getGlobalPermissions, getGroupsForPermissionType, getGroupsWithPermissions, getUsersForPermissionType, getUsersWithPermissions, removeAllPermissions, removeAllPermissions, removeAllPermissionsForGroup, removeAllPermissionsForGroup, removeAllUserPermissions, removeAllUserPermissions, removeAllUserPermissions, removeGlobalPermissionForUser, removeGlobalPermissionForUser, removePermission, removePermission, savePermission, savePermission
getDefaultGlobalPermissions, getUserAccessor, groupHasPermission, hasAllPermissions, hasGlobalPermissionViaGroups, hasPermission, hasPermission, hasPermissionForSpace
public static final String CACHE_KEY
public CachingSpacePermissionManager(SpacePermissionDao spacePermissionDao, PermissionCheckExemptions permissionCheckExemptions, SpacePermissionDefaultsStoreFactory spacePermissionDefaultsStoreFactory, com.atlassian.cache.CacheFactory cacheFactory, com.atlassian.event.api.EventPublisher eventPublisher, ConfluenceAccessManager confluenceAccessManager, SpacePermissionAccessMapper spacePermissionAccessMapper, com.atlassian.crowd.embedded.api.CrowdService crowdService, com.google.common.base.Supplier<UserAccessor> userAccessor)
public boolean permissionExists(SpacePermission permission)
If permission belongs to a space, it is looked up in the Space's own permissions list.
In addition, when lookAheadEnabled is true, #doLookAheadCache will be called and the results cached, provided permission does not belong to a space.
permissionExists
in interface DefaultConfluenceAccessManager.AccessManagerPermissionChecker
permissionExists
in interface SpacePermissionManager
permissionExists
in class DefaultSpacePermissionManager
permission
- the SpacePermission to look upprotected void savePermissionToDao(SpacePermission spacePermission)
savePermissionToDao
in class DefaultSpacePermissionManager
spacePermission
- the SpacePermission to saveprotected void removePermissionFromDao(SpacePermission spacePermission)
removePermissionFromDao
in class DefaultSpacePermissionManager
spacePermission
- the SpacePermission to removeprotected void removeAllPermissionsFromDao(Space space)
removeAllPermissionsFromDao
in class DefaultSpacePermissionManager
public void flushCaches()
flushCaches
in interface SpacePermissionManager
flushCaches
in class DefaultSpacePermissionManager
public boolean isLookAheadEnabled()
public void setLookAheadEnabled(boolean lookAheadEnabled)
public boolean hasPermissionNoExemptions(String permissionType, @Nullable Space space, @Nullable com.atlassian.user.User remoteUser)
SpacePermissionManager
SpacePermissionManager.hasPermission(String, Space, User)
does.
For parameter and return value information, see SpacePermissionManager.hasPermission(String, Space, User)
.
hasPermissionNoExemptions
in interface SpacePermissionManager
hasPermissionNoExemptions
in class AbstractSpacePermissionManager
protected Set<String> getGroupNamesWithPermission(@Nullable Space targetSpace, String permissionType)
getGroupNamesWithPermission
in class DefaultSpacePermissionManager
Copyright © 2003–2016 Atlassian. All rights reserved.