Package org.ametys.cms.workflow
Class AmetysObjectCheckRightsCondition
java.lang.Object
org.ametys.plugins.workflow.AbstractWorkflowComponent
org.ametys.plugins.workflow.component.CheckRightsCondition
org.ametys.cms.workflow.AmetysObjectCheckRightsCondition
- All Implemented Interfaces:
com.opensymphony.workflow.Condition,EnhancedCondition,Disposable,Initializable,LogEnabled,Serviceable
- Direct Known Subclasses:
FormCheckRightsCondition
Condition for checking rights of an user for the current action
using the right ametys object context.
The following configuration can be used for checking rights:
<condition type="avalon"> <arg name="role">org.ametys.cms.workflow.AmetysObjectCheckRightsCondition</arg> <arg name="right">Right_Edition</arg> </condition>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
AbstractWorkflowComponent.ConditionFailure -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant for storing the ametys object into the transient variables map.Fields inherited from class org.ametys.plugins.workflow.component.CheckRightsCondition
__CONTEXT_KEY, __DEFAULT_CONTEXT, __RIGHT_KEY, _i18nUtils, _rightManager, _rightsExtensionPoint, FORCEFields inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
_logger, _manager, CONTEXT_PARAMETERS_KEY, FAIL_CONDITIONS_KEY, RESULT_MAP_KEY, WORKFLOW_VALIDATION_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Object_computeContext(Map transientVars, Map args, UserIdentity user, String right) Compute the context to use.
Default implementation uses standard context"/cms".protected I18nizableText_getSingleConditionDescriptionKey(List<String> parameters) Get condition description when there is one rightprotected WorkflowAwareAmetysObjectgetAmetysObject(Map transientVars) Retrieve the ametys object associated with the workflow.getLabel()Get the label for this conditionMethods inherited from class org.ametys.plugins.workflow.component.CheckRightsCondition
_checkRights, _getMultipleConditionsDescriptionKey, _getRightsEnumerator, checkMultipleAndRights, checkMultipleOrRights, dispose, getArguments, getFullLabel, hasRight, initialize, passesConditionMethods inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
addWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser, serviceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.plugins.workflow.EnhancedCondition
getVisibilities
-
Field Details
-
AMETYS_OBJECT_KEY
Constant for storing the ametys object into the transient variables map.
-
-
Constructor Details
-
AmetysObjectCheckRightsCondition
public AmetysObjectCheckRightsCondition()
-
-
Method Details
-
_computeContext
protected Object _computeContext(Map transientVars, Map args, UserIdentity user, String right) throws com.opensymphony.workflow.WorkflowException Description copied from class:CheckRightsConditionCompute the context to use.
Default implementation uses standard context"/cms".- Overrides:
_computeContextin classCheckRightsCondition- Parameters:
transientVars- variables that will not be persisted.args- the properties for this function invocation.user- the current user.right- the needed right.- Returns:
- the computed context.
- Throws:
com.opensymphony.workflow.WorkflowException- if an error occurs.
-
getAmetysObject
protected WorkflowAwareAmetysObject getAmetysObject(Map transientVars) throws com.opensymphony.workflow.WorkflowException Retrieve the ametys object associated with the workflow.- Parameters:
transientVars- the parameters from the call.- Returns:
- the ametys object.
- Throws:
com.opensymphony.workflow.WorkflowException- if the content is not found.
-
getLabel
Description copied from interface:EnhancedConditionGet the label for this condition- Specified by:
getLabelin interfaceEnhancedCondition- Overrides:
getLabelin classCheckRightsCondition- Returns:
- the label
-
_getSingleConditionDescriptionKey
Description copied from class:CheckRightsConditionGet condition description when there is one right- Overrides:
_getSingleConditionDescriptionKeyin classCheckRightsCondition- Parameters:
parameters- the right label as a List- Returns:
- the description
-