Class AmetysObjectCheckRightsCondition

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 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>
 
  • Field Details

    • AMETYS_OBJECT_KEY

      public static final String AMETYS_OBJECT_KEY
      Constant for storing the ametys object into the transient variables map.
  • Constructor Details

  • 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 class CheckRightsCondition
      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.
    • _getSingleConditionDescriptionKey

      Description copied from class: CheckRightsCondition
      Get condition description when there is one right
      Overrides:
      _getSingleConditionDescriptionKey in class CheckRightsCondition
      Parameters:
      parameters - the right label as a List
      Returns:
      the description