Class WorflowRightHelper

java.lang.Object
org.ametys.plugins.workflow.support.WorflowRightHelper
All Implemented Interfaces:
Component, Serviceable

public class WorflowRightHelper extends Object implements Component, Serviceable
Helper for managing workflow rights
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Context
    The context
    protected RightManager
    Rights manager available to subclasses.
    The current user provider
    static final String
    The helper role
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canRead(com.opensymphony.workflow.loader.WorkflowDescriptor workflow)
    Check if user can read current workflow
    boolean
    canWrite(com.opensymphony.workflow.loader.WorkflowDescriptor workflow)
    Check if user can edit current workflow
    void
    Check if current user has edition rights to access function, throws IllegalAccessError if not
    void
    checkEditRight(com.opensymphony.workflow.loader.WorkflowDescriptor workflow)
    Check if current user has edition rights to access function on current workflow, throws IllegalAccessError if not
    void
    checkReadRight(com.opensymphony.workflow.loader.WorkflowDescriptor workflow)
    Check if current user has read rights to access function for specific workflow, throws IllegalAccessError if not
    boolean
    Check if current user has edit right for workflow system
    boolean
    Check if current user has edit right for workflow user
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • checkReadRight

      public void checkReadRight(com.opensymphony.workflow.loader.WorkflowDescriptor workflow)
      Check if current user has read rights to access function for specific workflow, throws IllegalAccessError if not
      Parameters:
      workflow - the current workflow
    • checkEditRight

      public void checkEditRight()
      Check if current user has edition rights to access function, throws IllegalAccessError if not
    • checkEditRight

      public void checkEditRight(com.opensymphony.workflow.loader.WorkflowDescriptor workflow)
      Check if current user has edition rights to access function on current workflow, throws IllegalAccessError if not
      Parameters:
      workflow - the current workflow
    • canWrite

      public boolean canWrite(com.opensymphony.workflow.loader.WorkflowDescriptor workflow)
      Check if user can edit current workflow
      Parameters:
      workflow - the current workflow
      Returns:
      true if user has the right needed to edit this workflow
    • canRead

      public boolean canRead(com.opensymphony.workflow.loader.WorkflowDescriptor workflow)
      Check if user can read current workflow
      Parameters:
      workflow - the current workflow
      Returns:
      true if user has the right needed to see this workflow
    • hasEditUserRight

      public boolean hasEditUserRight()
      Check if current user has edit right for workflow user
      Returns:
      true if user has edition rights for workflows user or system
    • hasEditSystemRight

      public boolean hasEditSystemRight()
      Check if current user has edit right for workflow system
      Returns:
      true if user has edition rights for workflows system