Available from versions: |
Check whether a given user has permission to perform an operation on an issue. This can include workflow properties if required.
boolean hasPermission(String permission, Issue issue, ApplicationUser user)
returns true if the permission short name is valid and the user has the permission according to the project permission scheme.
boolean hasWorkflowPermission(String permission, Issue issue, ApplicationUser user)
returns true if the permission short name is valid and the user has the permission according to the project permission scheme and any workflow properties for the current workflow status.
The first parameter of the two permission methods takes the “short name” of a project permission. For example, “browse” is the short name of the BROWSE_PROJECTS permission.
|
var user = userManager.getUserByName("admin"); if (jemhUtils.hasPermission("resolve", relatedIssue, user)) { print("checking permission scheme, user has resolve issue permission"); } |
var user = userManager.getUserByName("admin"); if (jemhUtils.hasWorkflowPermission("comment", relatedIssue, user)) { print("checking permissions scheme AND workflow properties, user has comment permission"); } |
The content by label feature displays related articles automatically, based on labels you choose. To edit options for this feature, select the placeholder below and tap the pencil icon.
|