Package org.ametys.cms.rights
Class ContentRightAssignmentContext
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.ui.StaticFileImportsClientSideElement
-
- org.ametys.core.ui.StaticClientSideElement
-
- org.ametys.core.right.AbstractStaticRightAssignmentContext
-
- org.ametys.cms.rights.ContentRightAssignmentContext
-
- All Implemented Interfaces:
RightAssignmentContext
,ClientSideElement
,LogEnabled
,PluginAware
,Configurable
,Contextualizable
,Serviceable
- Direct Known Subclasses:
ODFRightAssignmentContext
,UserDirectoryRightAssignmentContext
public class ContentRightAssignmentContext extends AbstractStaticRightAssignmentContext
RightAssignmentContext
for assign rights to aContent
or a jcr node root holding the contents
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile
-
-
Field Summary
Fields Modifier and Type Field Description protected AmetysObjectResolver
_resolver
The Ametys object resolverprotected RootContentHelper
_rootContentHelper
The root content helperstatic String
ID
The id if this right context-
Fields inherited from class org.ametys.core.right.AbstractStaticRightAssignmentContext
_context, _isPrivate, _reverseWorkspaceMather, _workspaceMatcher
-
Fields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
-
Constructor Summary
Constructors Constructor Description ContentRightAssignmentContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
convertJSContext(Object context)
From a JavaScript context object, converts it into a Java objectString
getContextIdentifier(Object context)
Gets the identifier of the object contextSet<Object>
getParentContexts(Object context)
Get the parent contexts of the object contextprotected Object
getRootContent()
Gets the root of contentsList<Object>
getRootContexts(Map<String,Object> contextParameters)
Get the list of root contexts if the current workspace matches the allowed workspaceList<ClientSideElement.Script>
getScripts(boolean ignoreRights, Map<String,Object> contextParameters)
This method return the scripts that will be used on client side.void
service(ServiceManager smanager)
-
Methods inherited from class org.ametys.core.right.AbstractStaticRightAssignmentContext
configure, contextualize, isPrivate, matchWorkspace
-
Methods inherited from class org.ametys.core.ui.StaticClientSideElement
_configureClass, _configureParameters, _configureScript, configureInitialParameters
-
Methods inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_configureDependencies, _configureImports, _configureRights, _configureRightsMode, getDependencies, getId, getPluginName, getRights, getScripts, hasRight, setPluginInfo, toString
-
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, wait, wait, wait
-
Methods inherited from interface org.ametys.core.ui.ClientSideElement
getDependencies, getId, getPluginName, getRights, getScripts
-
-
-
-
Field Detail
-
ID
public static final String ID
The id if this right context- See Also:
- Constant Field Values
-
_resolver
protected AmetysObjectResolver _resolver
The Ametys object resolver
-
_rootContentHelper
protected RootContentHelper _rootContentHelper
The root content helper
-
-
Constructor Detail
-
ContentRightAssignmentContext
public ContentRightAssignmentContext()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classStaticFileImportsClientSideElement
- Throws:
ServiceException
-
convertJSContext
public Object convertJSContext(Object context)
Description copied from interface:RightAssignmentContext
From a JavaScript context object, converts it into a Java object- Parameters:
context
- the JS context object- Returns:
- the Java object
-
getContextIdentifier
public String getContextIdentifier(Object context)
Description copied from interface:RightAssignmentContext
Gets the identifier of the object context- Parameters:
context
- The object context- Returns:
- the identifier of the object context
-
getParentContexts
public Set<Object> getParentContexts(Object context)
Description copied from interface:RightAssignmentContext
Get the parent contexts of the object context- Parameters:
context
- The object context- Returns:
- The parents if exist or
null
otherwise
-
getRootContexts
public List<Object> getRootContexts(Map<String,Object> contextParameters)
Description copied from interface:RightAssignmentContext
Get the list of root contexts if the current workspace matches the allowed workspace- Parameters:
contextParameters
- The contextual parameters- Returns:
- The root context object in a list
-
getScripts
public List<ClientSideElement.Script> getScripts(boolean ignoreRights, Map<String,Object> contextParameters)
Description copied from interface:ClientSideElement
This method return the scripts that will be used on client side. This class will be parametrized by initial and current parameters.- Specified by:
getScripts
in interfaceClientSideElement
- Overrides:
getScripts
in classAbstractStaticRightAssignmentContext
- Parameters:
ignoreRights
- True to ignore the rights verification.contextParameters
- Contextuals parameters transmitted by the environment.- Returns:
- The list of scripts or an empty list.
-
getRootContent
protected Object getRootContent()
Gets the root of contents- Returns:
- the root of contents
-
-