Class WorflowRightHelper
java.lang.Object
org.ametys.plugins.workflow.support.WorflowRightHelper
- All Implemented Interfaces:
Component
,Serviceable
Helper for managing workflow rights
-
Field Summary
Modifier and TypeFieldDescriptionprotected Context
The contextprotected RightManager
Rights manager available to subclasses.protected CurrentUserProvider
The current user providerstatic final String
The helper role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canRead
(com.opensymphony.workflow.loader.WorkflowDescriptor workflow) Check if user can read current workflowboolean
canWrite
(com.opensymphony.workflow.loader.WorkflowDescriptor workflow) Check if user can edit current workflowvoid
Check if current user has edition rights to access function, throws IllegalAccessError if notvoid
checkEditRight
(com.opensymphony.workflow.loader.WorkflowDescriptor workflow) Check if current user has edition rights to access function on current workflow, throws IllegalAccessError if notvoid
checkReadRight
(com.opensymphony.workflow.loader.WorkflowDescriptor workflow) Check if current user has read rights to access function for specific workflow, throws IllegalAccessError if notboolean
Check if current user has edit right for workflow systemboolean
Check if current user has edit right for workflow uservoid
service
(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:
service
in 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
-