Class WorflowRightHelper
java.lang.Object
org.ametys.plugins.workflow.support.WorflowRightHelper
- All Implemented Interfaces:
Component,Serviceable
Helper for managing workflow rights
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContextThe contextprotected RightManagerRights manager available to subclasses.protected CurrentUserProviderThe current user providerstatic final StringThe helper role -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanRead(com.opensymphony.workflow.loader.WorkflowDescriptor workflow) Check if user can read current workflowbooleancanWrite(com.opensymphony.workflow.loader.WorkflowDescriptor workflow) Check if user can edit current workflowvoidCheck if current user has edition rights to access function, throws IllegalAccessError if notvoidcheckEditRight(com.opensymphony.workflow.loader.WorkflowDescriptor workflow) Check if current user has edition rights to access function on current workflow, throws IllegalAccessError if notvoidcheckReadRight(com.opensymphony.workflow.loader.WorkflowDescriptor workflow) Check if current user has read rights to access function for specific workflow, throws IllegalAccessError if notbooleanCheck if current user has edit right for workflow systembooleanCheck if current user has edit right for workflow uservoidservice(ServiceManager manager)
-
Field Details
-
ROLE
The helper role -
_rightManager
Rights manager available to subclasses. -
_context
The context -
_userProvider
The current user provider
-
-
Constructor Details
-
WorflowRightHelper
public WorflowRightHelper()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
checkReadRight
Check if current user has read rights to access function for specific workflow, throws IllegalAccessError if not- Parameters:
workflow- the current workflow
-
checkEditRight
Check if current user has edition rights to access function, throws IllegalAccessError if not -
checkEditRight
Check if current user has edition rights to access function on current workflow, throws IllegalAccessError if not- Parameters:
workflow- the current workflow
-
canWrite
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
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
Check if current user has edit right for workflow user- Returns:
- true if user has edition rights for workflows user or system
-
hasEditSystemRight
Check if current user has edit right for workflow system- Returns:
- true if user has edition rights for workflows system
-