Package org.ametys.web.rights
Class WebWorkspaceAccessController
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.core.impl.right.AbstractProfileStorageBasedAccessController
org.ametys.plugins.core.impl.right.AbstractHierarchicalWithPermissionContextAccessController<T,T>
org.ametys.plugins.core.impl.right.AbstractHierarchicalAccessController<String>
org.ametys.plugins.core.impl.right.StringHierarchicalAccessController
org.ametys.web.rights.WebWorkspaceAccessController
- All Implemented Interfaces:
AccessController
,LogEnabled
,PluginAware
,Initializable
,Configurable
,Contextualizable
,Serviceable
- Direct Known Subclasses:
SiteWorkspaceAccessController
public class WebWorkspaceAccessController
extends StringHierarchicalAccessController
implements Contextualizable
This impl of
WorkspaceAccessController
will add the current sitemap to the cms workspace-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.plugins.core.impl.right.AbstractHierarchicalWithPermissionContextAccessController
AbstractHierarchicalWithPermissionContextAccessController.HierarchicalAccessResultDetails
Nested classes/interfaces inherited from class org.ametys.plugins.core.impl.right.AbstractProfileStorageBasedAccessController
AbstractProfileStorageBasedAccessController.CacheKind, AbstractProfileStorageBasedAccessController.PermissionDetails
Nested classes/interfaces inherited from interface org.ametys.core.right.AccessController
AccessController.AccessResult, AccessController.ExplanationObject, AccessController.Permission
-
Field Summary
Fields inherited from class org.ametys.plugins.core.impl.right.StringHierarchicalAccessController
_prefixes, _reverseWorkspaceMather, _workspaceMatcher, SEPARATOR
Fields inherited from class org.ametys.plugins.core.impl.right.AbstractProfileStorageBasedAccessController
__ANONYMOUS_USER_IDENTITY, __ANY_CONTECTED_USER_IDENTITY, _cacheManager, _groupManager, _profileAssignmentStorageEP, _rightProfileDAO
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Object
_convertContext
(Object initialContext) For methods getXXXXPermissionYYY allow to have a modification of the context before transferring it to the profile assignment storage extension point The default implemenation keep the context as it isprotected String
Get the current site nameprotected boolean
_isSupportedStoredContext
(Object storedObject) Determine if a stored context is handled by this controller.protected Object
_unconvertContext
(Object storedObject) For methodAbstractProfileStorageBasedAccessController.explainAllPermissions(UserIdentity, Set)
, determine if the object is the result of a conversion by theAbstractProfileStorageBasedAccessController._convertContext(Object)
method and if so, returns the original context.void
contextualize
(Context context) getObjectCategory
(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 I18nizableText
getObjectLabelForExplanation
(Object object) Get the label describing the object in the explanation sentence.Get the prefix of the path acceptedGet the prefix of the path acceptedMethods inherited from class org.ametys.plugins.core.impl.right.StringHierarchicalAccessController
_convertWorkspaceToRootRightContexts, _getParents, configure, isSupported
Methods inherited from class org.ametys.plugins.core.impl.right.AbstractHierarchicalAccessController
_getParents
Methods inherited from class org.ametys.plugins.core.impl.right.AbstractHierarchicalWithPermissionContextAccessController
_getExplanationI18nText, _getPermission, _getPermission, _getPermissionByGroup, _getPermissionByGroup, _getPermissionByUser, _getPermissionByUser, _getPermissionContext, _getPermissionDetails, _getPermissionDetails, _getPermissionDetailsForAnonymous, _getPermissionDetailsForAnonymous, _getPermissionDetailsForAnyConnectedUser, _getPermissionDetailsForAnyConnectedUser, _getPermissionForAnonymous, _getPermissionForAnonymous, _getPermissionForAnyConnectedUser, _getPermissionForAnyConnectedUser, getPermissionByRight, getPermissionByRight, isInheritanceAllowed
Methods inherited from class org.ametys.plugins.core.impl.right.AbstractProfileStorageBasedAccessController
_buildExplanation, _explainPermission, _explainPermissionForAnonymous, _explainPermissionForAnyConnectedUser, _getAccessExplanationI18nKey, _getExplanationI18nParams, _hasRightResultInFirstCache, _hasRightResultInSecondCache, _putInFirstCache, _putInSecondCache, 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, service, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.core.right.AccessController
getExplanationObject, getObjectPriority, getStandardAccessExplanation
-
Constructor Details
-
WebWorkspaceAccessController
public WebWorkspaceAccessController()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
getSupportedPrefixes
Description copied from class:StringHierarchicalAccessController
Get the prefix of the path accepted- Overrides:
getSupportedPrefixes
in classStringHierarchicalAccessController
- Returns:
- The non-null and non-empty prefixes, starting by '/'
-
_convertContext
Description copied from class:AbstractProfileStorageBasedAccessController
For methods getXXXXPermissionYYY allow to have a modification of the context before transferring it to the profile assignment storage extension point The default implemenation keep the context as it is- Overrides:
_convertContext
in classAbstractProfileStorageBasedAccessController
- Parameters:
initialContext
- The right context that is supported- Returns:
- the context modified
-
_isSupportedStoredContext
Description copied from class:AbstractProfileStorageBasedAccessController
Determine if a stored context is handled by this controller. Default implementation returns the result ofAccessController.isSupported(Object)
as no conversion is done by default on object context before storage (seeAbstractProfileStorageBasedAccessController._convertContext(Object)
)- Overrides:
_isSupportedStoredContext
in classAbstractProfileStorageBasedAccessController
- Parameters:
storedObject
- a stored object- Returns:
- true if the context is supported
-
_unconvertContext
Description copied from class:AbstractProfileStorageBasedAccessController
For methodAbstractProfileStorageBasedAccessController.explainAllPermissions(UserIdentity, Set)
, determine if the object is the result of a conversion by theAbstractProfileStorageBasedAccessController._convertContext(Object)
method and if so, returns the original context.- Overrides:
_unconvertContext
in classAbstractProfileStorageBasedAccessController
- Parameters:
storedObject
- the object holding the stored permission- Returns:
- the original context supported by this controller or
Optional.empty()
-
getRootPrefixes
Description copied from class:StringHierarchicalAccessController
Get the prefix of the path accepted- Overrides:
getRootPrefixes
in classStringHierarchicalAccessController
- Returns:
- The non-null and non-empty prefixes, starting by '/'
-
_getSiteName
Get the current site name- Returns:
- the current site name
-
getObjectLabelForExplanation
Description copied from class:AbstractProfileStorageBasedAccessController
Get the label describing the object in the explanation sentence.- Overrides:
getObjectLabelForExplanation
in classStringHierarchicalAccessController
- 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:AccessController
Get a label describing the object handled by this access controller- Specified by:
getObjectLabel
in interfaceAccessController
- Overrides:
getObjectLabel
in classStringHierarchicalAccessController
- Parameters:
object
- the object- Returns:
- the label
-
getObjectCategory
Description copied from interface:AccessController
Get a label classifying the object handled by this access controller- Specified by:
getObjectCategory
in interfaceAccessController
- Overrides:
getObjectCategory
in classStringHierarchicalAccessController
- Parameters:
object
- the object- Returns:
- the label
-