Class CachingInheritedContentPermissionManager
- java.lang.Object
-
- com.atlassian.confluence.impl.security.CachingInheritedContentPermissionManager
-
- All Implemented Interfaces:
InheritedContentPermissionManager
public class CachingInheritedContentPermissionManager extends Object implements InheritedContentPermissionManager
AnInheritedContentPermissionManager
implementation that delegates to another, and caches the lookups.Replaces
com.atlassian.confluence.core.CachingInheritedContentPermissionManager
- Since:
- 7.5
- See Also:
ContentPermissionSetCache
-
-
Constructor Summary
Constructors Constructor Description CachingInheritedContentPermissionManager(InheritedContentPermissionManager delegate, ContentPermissionSetDao contentPermissionSetDao, PageDao pageDao, TransactionAwareCacheFactory cacheFactory, com.atlassian.event.api.EventListenerRegistrar eventListenerRegistrar)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<ContentPermissionSet>
getInheritedContentPermissionSets(ContentEntityObject contentEntityObject)
List<ContentPermissionSet>
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
registerEventListener()
void
unregisterEventListener()
-
-
-
Constructor Detail
-
CachingInheritedContentPermissionManager
public CachingInheritedContentPermissionManager(InheritedContentPermissionManager delegate, ContentPermissionSetDao contentPermissionSetDao, PageDao pageDao, TransactionAwareCacheFactory cacheFactory, com.atlassian.event.api.EventListenerRegistrar eventListenerRegistrar)
-
-
Method Detail
-
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
@EventListener public 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. Its a bit draconian and could probably be refined to be more selective in what it clears, but this is the safe approach.
-
onEvent
@EventListener public void onEvent(AncestorsUpdateEvent event)
-
registerEventListener
@PostConstruct public void registerEventListener()
-
unregisterEventListener
@PreDestroy public void unregisterEventListener()
-
-