Package org.ametys.core.right
Class AbstractStaticRightAssignmentContext
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.ui.StaticFileImportsClientSideElement
-
- org.ametys.core.ui.StaticClientSideElement
-
- org.ametys.core.right.AbstractStaticRightAssignmentContext
-
- All Implemented Interfaces:
RightAssignmentContext,ClientSideElement,LogEnabled,PluginAware,Configurable,Contextualizable,Serviceable
- Direct Known Subclasses:
CartRightAssignmentContext,ContentRightAssignmentContext,LinkDirectoryRightAssignmentContext,PageRightAssignmentContext,QueriesDirectoryRightAssignmentContext,ReferenceTableRightAssignmentContext,ResourceRightAssignmentContext,StringRightAssignmentContext,SurveyRightAssignmentContext,SynchronizeContentRightAssignmentContext
public abstract class AbstractStaticRightAssignmentContext extends StaticClientSideElement implements RightAssignmentContext, Contextualizable
This static impl is a static client side element that take care that the current workspace matches a configured regexp
-
-
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 Context_contextThe avalon contextprotected boolean_isPrivateThe private propertyprotected boolean_reverseWorkspaceMatherConsider _workspaceMatcher negativelyprotected Pattern_workspaceMatcherThe regexp that should match current workspace-
Fields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
-
Constructor Summary
Constructors Constructor Description AbstractStaticRightAssignmentContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(Configuration configuration)voidcontextualize(Context context)List<ClientSideElement.Script>getScripts(boolean ignoreRights, Map<String,Object> contextParameters)This method return the scripts that will be used on client side.booleanisPrivate()Determines if this rights assignment context is a private contextprotected booleanmatchWorkspace(Map<String,Object> contextParameters)Determines if the current workspace matches the configured workspace regexp-
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, service, 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
-
Methods inherited from interface org.ametys.core.right.RightAssignmentContext
convertJSContext, getContextIdentifier, getParentContexts, getRootContexts
-
-
-
-
Field Detail
-
_isPrivate
protected boolean _isPrivate
The private property
-
_workspaceMatcher
protected Pattern _workspaceMatcher
The regexp that should match current workspace
-
_reverseWorkspaceMather
protected boolean _reverseWorkspaceMather
Consider _workspaceMatcher negatively
-
-
Constructor Detail
-
AbstractStaticRightAssignmentContext
public AbstractStaticRightAssignmentContext()
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classStaticFileImportsClientSideElement- Throws:
ConfigurationException
-
getScripts
public List<ClientSideElement.Script> getScripts(boolean ignoreRights, Map<String,Object> contextParameters)
Description copied from interface:ClientSideElementThis method return the scripts that will be used on client side. This class will be parametrized by initial and current parameters.- Specified by:
getScriptsin interfaceClientSideElement- Overrides:
getScriptsin classStaticFileImportsClientSideElement- Parameters:
ignoreRights- True to ignore the rights verification.contextParameters- Contextuals parameters transmitted by the environment.- Returns:
- The list of scripts or an empty list.
-
isPrivate
public boolean isPrivate()
Description copied from interface:RightAssignmentContextDetermines if this rights assignment context is a private context- Specified by:
isPrivatein interfaceRightAssignmentContext- Returns:
- true if is private
-
matchWorkspace
protected boolean matchWorkspace(Map<String,Object> contextParameters)
Determines if the current workspace matches the configured workspace regexp- Parameters:
contextParameters- The contextual parameters- Returns:
- true if the current workspace matches
-
-