Interface WorkflowPermission
public interface WorkflowPermission
Interface providing methods to define workflow permissions
- Since:
- 3.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
allowGroup
(Group group) Allow the given group to execute the workflow.void
Allow the given user to execute the workflow.boolean
Indicates whether the permission is applicable for all workflows.void
forbidGroup
(Group group) Forbid the given group to execute the workflow.void
forbidUser
(User user) Forbid the given user to execute the workflow.Group[]
Get all groups which users are allowed to execute the workflow.User[]
Get all users which are allowed to execute the workflow.getTransitionPermission
(Transition transition) Get all permissions for the given transition.Get the permissions for all transitions of the workflow.@Nullable Workflow
Gets the workflow.boolean
isUserAllowed
(User user) Check if the given user is allowed to execute the workflow.void
Remove the permissions for all transitions of the workflow.void
removeTransitionPermission
(Transition transition) Remove the permissions for the given transition.void
setAllowedGroups
(Group[] groups) Set several groups that should be allowed to execute the workflow.void
setAllowedUsers
(User[] users) Set several user that should be allowed to execute the workflow.void
setTransitionPermissions
(WorkflowTransitionPermission[] permissions) Set several permission for the workflow transitions.void
setUseReleasePermission
(boolean use) Define if the release permission should be used.boolean
The definition if the release permission should be used.
-
Method Details
-
getWorkflow
Gets the workflow.- Since:
- 3.0
-
allWorkflows
boolean allWorkflows()Indicates whether the permission is applicable for all workflows.- Returns:
true
, if applicable for all workflows.- Since:
- 3.0
-
getAllowedUsers
User[] getAllowedUsers()Get all users which are allowed to execute the workflow.- Since:
- 3.0
-
getAllowedGroups
Group[] getAllowedGroups()Get all groups which users are allowed to execute the workflow.- Since:
- 3.0
-
forbidUser
Forbid the given user to execute the workflow.- Parameters:
user
- The user who shouldn't be allowed to execute the workflow.- Since:
- 3.0
-
allowUser
Allow the given user to execute the workflow.- Parameters:
user
- The user who should be allowed to execute the workflow.- Since:
- 3.0
-
forbidGroup
Forbid the given group to execute the workflow.- Parameters:
group
- The group that should not be allowed to execute the workflow.- Since:
- 3.0
-
allowGroup
Allow the given group to execute the workflow.- Parameters:
group
- The group that should be allowed to execute the workflow.- Since:
- 3.0
-
setAllowedUsers
Set several user that should be allowed to execute the workflow.- Parameters:
users
- The users that should be allowed to execute the workflow.- Since:
- 3.0
-
setAllowedGroups
Set several groups that should be allowed to execute the workflow.- Parameters:
groups
- The groups that should be allowed to execute the workflow.- Since:
- 3.0
-
getTransitionPermissions
WorkflowTransitionPermission[] getTransitionPermissions()Get the permissions for all transitions of the workflow.- Since:
- 3.0
-
getTransitionPermission
Get all permissions for the given transition. Creates a newWorkflowTransitionPermission
if no permissions are defined yet for the given transition.- Parameters:
transition
- The transition for which the permissions should be determined.- Since:
- 3.0
-
setTransitionPermissions
Set several permission for the workflow transitions.- Parameters:
permissions
- The permissions that should be set for the workflow transitions.- Since:
- 3.0
-
removeTransitionPermission
Remove the permissions for the given transition.- Parameters:
transition
- The given transition for which the permissions should be removed.- Since:
- 3.0
-
removeAllTransitionPermissions
void removeAllTransitionPermissions()Remove the permissions for all transitions of the workflow.- Since:
- 3.0
-
isUserAllowed
Check if the given user is allowed to execute the workflow.- Parameters:
user
- boolean:true
if the given user is allowed to execute the workflow,false
if it is forbidden- Since:
- 3.0
-
useReleasePermission
boolean useReleasePermission()The definition if the release permission should be used.true
: the permission should be usedfalse
: the permission should not be used
- Since:
- 3.0
-
setUseReleasePermission
void setUseReleasePermission(boolean use) Define if the release permission should be used.- Parameters:
use
- boolean:true
if the release permission should be used, {code false} otherwise- Since:
- 3.0
-