Class CachingInheritedContentPermissionManager
java.lang.Object
com.atlassian.confluence.impl.security.CachingInheritedContentPermissionManager
- All Implemented Interfaces:
InheritedContentPermissionManager
public class CachingInheritedContentPermissionManager
extends Object
implements InheritedContentPermissionManager
An
InheritedContentPermissionManager
implementation that delegates to another, and caches the lookups.
Replaces com.atlassian.confluence.core.CachingInheritedContentPermissionManager
- Since:
- 7.5
- See Also:
-
ContentPermissionSetCache
-
Constructor Summary
ConstructorDescriptionCachingInheritedContentPermissionManager
(InheritedContentPermissionManager delegate, ContentPermissionSetDao contentPermissionSetDao, PageDaoInternal pageDao, TransactionAwareCacheFactory cacheFactory, com.atlassian.event.api.EventListenerRegistrar eventListenerRegistrar) -
Method Summary
Modifier and TypeMethodDescriptiongetInheritedContentPermissionSets
(ContentEntityObject contentEntityObject) getInheritedContentPermissionSetsIncludeEdit
(ContentEntityObject contentEntityObject) void
onEvent
(AncestorsUpdateEvent event) void
onEvent
(ContentPermissionEvent event) On reception of anyContentPermissionEvent
we clear the cache of any permissions related to the event's referencedContentEntityObject
and any of its descendents.void
void
-
Constructor Details
-
CachingInheritedContentPermissionManager
public CachingInheritedContentPermissionManager(InheritedContentPermissionManager delegate, ContentPermissionSetDao contentPermissionSetDao, PageDaoInternal pageDao, TransactionAwareCacheFactory cacheFactory, com.atlassian.event.api.EventListenerRegistrar eventListenerRegistrar)
-
-
Method Details
-
getInheritedContentPermissionSets
public List<ContentPermissionSet> getInheritedContentPermissionSets(ContentEntityObject contentEntityObject) - Specified by:
getInheritedContentPermissionSets
in interfaceInheritedContentPermissionManager
- Returns:
- a list of
ContentPermissionSet
s of typeContentPermission.VIEW_PERMISSION
of all ancestors of contentEntityObject
-
getInheritedContentPermissionSetsIncludeEdit
public List<ContentPermissionSet> getInheritedContentPermissionSetsIncludeEdit(ContentEntityObject contentEntityObject) - Specified by:
getInheritedContentPermissionSetsIncludeEdit
in interfaceInheritedContentPermissionManager
- Parameters:
contentEntityObject
- content to get inherited permissions for- Returns:
- list of all permissions on the given content, including permissions of type
ContentPermission.EDIT_PERMISSION
-
onEvent
On reception of anyContentPermissionEvent
we clear the cache of any permissions related to the event's referencedContentEntityObject
and any of its descendents. Its a bit draconian and could probably be refined to be more selective in what it clears, but this is the safe approach. -
onEvent
-
registerEventListener
@PostConstruct public void registerEventListener() -
unregisterEventListener
@PreDestroy public void unregisterEventListener()
-