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
ConstructorsConstructorDescriptionCachingInheritedContentPermissionManager(InheritedContentPermissionManager delegate, ContentPermissionSetDao contentPermissionSetDao, PageDaoInternal pageDao, TransactionAwareCacheFactory cacheFactory, com.atlassian.event.api.EventListenerRegistrar eventListenerRegistrar) -
Method Summary
Modifier and TypeMethodDescriptiongetInheritedContentPermissionSets(ContentEntityObject contentEntityObject) getInheritedContentPermissionSetsIncludeEdit(ContentEntityObject contentEntityObject) voidonEvent(AncestorsUpdateEvent event) voidonEvent(ContentPermissionEvent event) On reception of anyContentPermissionEventwe clear the cache of any permissions related to the event's referencedContentEntityObjectand any of its descendents.voidvoid
-
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:
getInheritedContentPermissionSetsin interfaceInheritedContentPermissionManager- Returns:
- a list of
ContentPermissionSets of typeContentPermission.VIEW_PERMISSIONof all ancestors of contentEntityObject
-
getInheritedContentPermissionSetsIncludeEdit
public List<ContentPermissionSet> getInheritedContentPermissionSetsIncludeEdit(ContentEntityObject contentEntityObject) - Specified by:
getInheritedContentPermissionSetsIncludeEditin 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 anyContentPermissionEventwe clear the cache of any permissions related to the event's referencedContentEntityObjectand 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()
-