Package org.ametys.odf.rights
Class ODFContentHierarchicalAccessController
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.core.impl.right.AbstractProfileStorageBasedAccessController
org.ametys.plugins.core.impl.right.AbstractHierarchicalWithPermissionContextAccessController<AmetysObject,ODFRightHelper.PermissionContext>
org.ametys.odf.rights.ODFContentHierarchicalAccessController
- All Implemented Interfaces:
AccessController,LogEnabled,PluginAware,Initializable,Serviceable
public class ODFContentHierarchicalAccessController
extends AbstractHierarchicalWithPermissionContextAccessController<AmetysObject,ODFRightHelper.PermissionContext>
AccessController for a ODF Content-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.plugins.core.impl.right.AbstractHierarchicalWithPermissionContextAccessController
AbstractHierarchicalWithPermissionContextAccessController.HierarchicalAccessResultDetailsNested classes/interfaces inherited from class org.ametys.plugins.core.impl.right.AbstractProfileStorageBasedAccessController
AbstractProfileStorageBasedAccessController.CacheKind, AbstractProfileStorageBasedAccessController.PermissionDetailsNested classes/interfaces inherited from interface org.ametys.core.right.AccessController
AccessController.AccessResult, AccessController.ExplanationObject, AccessController.Permission -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentHelperThe helper for contentsprotected ODFContentsTreeHelperThe ODF contents tree helperprotected ODFHelperThe helper for root contentprotected ODFRightHelperThe right helper for ODF contentsprotected AmetysObjectResolverAmetys Object Resolverstatic final I18nizableTextthe odf context categoryFields inherited from class org.ametys.plugins.core.impl.right.AbstractProfileStorageBasedAccessController
__ANONYMOUS_USER_IDENTITY, __ANY_CONTECTED_USER_IDENTITY, _cacheManager, _groupManager, _profileAssignmentStorageEP, _rightProfileDAO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_convertWorkspaceToRootRightContexts(Set<Object> workspacesContexts) Get the current workspaces contexts and turn it into root contexts in order to allow methods hasXXXAnyPermissionOnWorkspace to workprotected Set<AmetysObject>_getParents(AmetysObject object, ODFRightHelper.PermissionContext permissionCtx) Gets the parents of the object.protected ODFRightHelper.PermissionContext_getPermissionContext(AmetysObject initialObject) Get the permission context.static I18nizableTextgetContentObjectLabel(Content content, ODFContentsTreeHelper helper) Get a standardized object label for an ODF contentgetObjectCategory(Object object) Get a label classifying the object handled by this access controllergetObjectLabel(Object object) Get a label describing the object handled by this access controllerprotected I18nizableTextgetObjectLabelForExplanation(Object object) Get the label describing the object in the explanation sentence.intgetObjectPriority(Object object) Get the priority of the object to order it in its categorybooleanisSupported(Object object) Returns true if this access controller supports the given objectvoidservice(ServiceManager manager) Methods inherited from class org.ametys.plugins.core.impl.right.AbstractHierarchicalWithPermissionContextAccessController
_getExplanationI18nText, _getPermission, _getPermission, _getPermissionByGroup, _getPermissionByGroup, _getPermissionByUser, _getPermissionByUser, _getPermissionDetails, _getPermissionDetails, _getPermissionDetailsForAnonymous, _getPermissionDetailsForAnonymous, _getPermissionDetailsForAnyConnectedUser, _getPermissionDetailsForAnyConnectedUser, _getPermissionForAnonymous, _getPermissionForAnonymous, _getPermissionForAnyConnectedUser, _getPermissionForAnyConnectedUser, getPermissionByRight, getPermissionByRight, isInheritanceAllowedMethods inherited from class org.ametys.plugins.core.impl.right.AbstractProfileStorageBasedAccessController
_buildExplanation, _convertContext, _explainPermission, _explainPermissionForAnonymous, _explainPermissionForAnyConnectedUser, _getAccessExplanationI18nKey, _getExplanationI18nParams, _hasRightResultInFirstCache, _hasRightResultInSecondCache, _isSupportedStoredContext, _putInFirstCache, _putInSecondCache, _unconvertContext, explainAllPermissions, explainPermission, explainPermissionForAnonymous, explainPermissionForAnyConnectedUser, explainReadAccessPermission, explainReadAccessPermissionForAnonymous, explainReadAccessPermissionForAnyConnectedUser, getId, getPermission, getPermissionByGroup, getPermissionByUser, getPermissionForAnonymous, getPermissionForAnyConnectedUser, getReadAccessPermission, getReadAccessPermissionByGroup, getReadAccessPermissionByUser, getReadAccessPermissionForAnonymous, getReadAccessPermissionForAnyConnectedUser, hasAnonymousAnyPermissionOnWorkspace, hasAnonymousAnyReadAccessPermissionOnWorkspace, hasAnyConnectedUserAnyPermissionOnWorkspace, hasAnyConnectedUserAnyReadAccessPermissionOnWorkspace, hasUserAnyPermissionOnWorkspace, hasUserAnyReadAccessPermissionOnWorkspace, initialize, setPluginInfoMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.core.right.AccessController
getExplanationObject, getStandardAccessExplanation
-
Field Details
-
ODF_CONTEXT_CATEGORY
the odf context category -
_odfHelper
The helper for root content -
_contentHelper
The helper for contents -
_resolver
Ametys Object Resolver -
_odfRightHelper
The right helper for ODF contents -
_odfContentTreeHelper
The ODF contents tree helper
-
-
Constructor Details
-
ODFContentHierarchicalAccessController
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractProfileStorageBasedAccessController- Throws:
ServiceException
-
isSupported
Description copied from interface:AccessControllerReturns true if this access controller supports the given object- Parameters:
object- The object to test- Returns:
- true if this access controller supports the given object
-
_getParents
protected Set<AmetysObject> _getParents(AmetysObject object, ODFRightHelper.PermissionContext permissionCtx) Description copied from class:AbstractHierarchicalWithPermissionContextAccessControllerGets the parents of the object. Must return null when the object is the "root" (where "root" means here the root of the hierarchy of the access controller)- Specified by:
_getParentsin classAbstractHierarchicalWithPermissionContextAccessController<AmetysObject,ODFRightHelper.PermissionContext> - Parameters:
object- The objectpermissionCtx- The permission context- Returns:
- the parents of the object, or null if the object is the "root" of the hierarchy
-
_getPermissionContext
Description copied from class:AbstractHierarchicalWithPermissionContextAccessControllerGet the permission context. By default the permission context is the initial object context- Overrides:
_getPermissionContextin classAbstractHierarchicalWithPermissionContextAccessController<AmetysObject,ODFRightHelper.PermissionContext> - Parameters:
initialObject- the initial object context- Returns:
- the permission context.
-
_convertWorkspaceToRootRightContexts
protected Set<? extends Object> _convertWorkspaceToRootRightContexts(Set<Object> workspacesContexts) Description copied from class:AbstractProfileStorageBasedAccessControllerGet the current workspaces contexts and turn it into root contexts in order to allow methods hasXXXAnyPermissionOnWorkspace to work- Specified by:
_convertWorkspaceToRootRightContextsin classAbstractProfileStorageBasedAccessController- Parameters:
workspacesContexts- The workspace contexts. Such as '/${WorkspaceName}', '/admin'- Returns:
- A null or empty set if the current AccessController does not apply to any workspace context, or the root object where ProfileAssignmentStorageExtension should start looking at to find any permission
-
getObjectLabelForExplanation
Description copied from class:AbstractProfileStorageBasedAccessControllerGet the label describing the object in the explanation sentence.- Overrides:
getObjectLabelForExplanationin classAbstractProfileStorageBasedAccessController- Parameters:
object- the object that granted the right- Returns:
- the label
- Throws:
RightsException- when the object is not supported by the controller
-
getObjectLabel
Description copied from interface:AccessControllerGet a label describing the object handled by this access controller- Parameters:
object- the object- Returns:
- the label
-
getObjectCategory
Description copied from interface:AccessControllerGet a label classifying the object handled by this access controller- Parameters:
object- the object- Returns:
- the label
-
getObjectPriority
Description copied from interface:AccessControllerGet the priority of the object to order it in its category- Parameters:
object- the object- Returns:
- the priority
-
getContentObjectLabel
Get a standardized object label for an ODF content- Parameters:
content- the contenthelper- the ODF content tree helper- Returns:
- the label
-