Package org.ametys.cms.workflow
Class ContentCheckRightsCondition
java.lang.Object
org.ametys.plugins.workflow.AbstractWorkflowComponent
org.ametys.plugins.workflow.component.CheckRightsCondition
org.ametys.cms.workflow.ContentCheckRightsCondition
- All Implemented Interfaces:
com.opensymphony.workflow.Condition
,EnhancedCondition
,Disposable
,Initializable
,LogEnabled
,Serviceable
Condition for checking rights of an user for the current action
using the right content context.
The following configuration can be used for checking rights:
<condition type="avalon"> <arg name="role">org.ametys.cms.workflow.ContentCheckRigthsCondition</arg> <arg name="right">Right_Edition</arg> </condition>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.plugins.workflow.EnhancedCondition
EnhancedCondition.ConditionArgument
-
Field Summary
Fields inherited from class org.ametys.plugins.workflow.component.CheckRightsCondition
__CONTEXT_KEY, __DEFAULT_CONTEXT, __RIGHT_KEY, _i18nUtils, _rightManager, _rightsExtensionPoint, FORCE
Fields inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
_logger, _manager, CONTEXT_PARAMETERS_KEY, FAIL_CONDITIONS_KEY, RESULT_MAP_KEY, WORKFLOW_ERRORS_KEY, WORKFLOW_WARNS_KEY
-
Constructor Summary
-
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 WorkflowAwareContent
getContent
(Map transientVars) Retrieve the content associated with the workflow.Methods inherited from class org.ametys.plugins.workflow.component.CheckRightsCondition
_checkRights, _getMultipleConditionsDescriptionKey, checkMultipleAndRights, checkMultipleOrRights, dispose, getArguments, getDescription, hasRight, initialize, passesCondition
Methods inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
addWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser, service
-
Constructor Details
-
ContentCheckRightsCondition
public ContentCheckRightsCondition()
-
-
Method Details
-
_computeContext
protected Object _computeContext(Map transientVars, Map args, UserIdentity user, String right) throws com.opensymphony.workflow.WorkflowException Description copied from class:CheckRightsCondition
Compute the context to use.
Default implementation uses standard context"/cms"
.- Overrides:
_computeContext
in 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.
-
getContent
protected WorkflowAwareContent getContent(Map transientVars) throws com.opensymphony.workflow.WorkflowException Retrieve the content associated with the workflow.- Parameters:
transientVars
- the parameters from the call.- Returns:
- the content.
- Throws:
com.opensymphony.workflow.WorkflowException
- if the content is not found.
-
_getSingleConditionDescriptionKey
Description copied from class:CheckRightsCondition
Get condition description when there is one right- Overrides:
_getSingleConditionDescriptionKey
in classCheckRightsCondition
- Parameters:
parameters
- the right label as a List- Returns:
- the description
-