User Permissions Functions
Function
Signature
Meaning
Availability
userInGroup
boolean userInGroup(UserDto user, String... groups)
Returns true, if the specified user is member in at least one of the specified user groups, otherwise false.
Codebeamer 9.2 and later
userInRole
boolean userInRole(UserDto user, ProjectDto project, String... roles)
Returns true, if the specified user has at least one of the specified roles in the specified project, otherwise false.
Codebeamer 9.2 and later
userHasPermission
boolean userHasPermission(UserDto user, String... permissions)
Returns true, if the specified user has at least one of the specified system permissions (see table below), otherwise false.
Codebeamer 9.2 and later
userHasProjectPermission
boolean userHasProjectPermission(UserDto user, ProjectDto project, String... permissions)
Returns true, if the specified user has at least one of the specified sroject permissions (see table below) on the specified project, otherwise false
Codebeamer 9.2 and later
userHasTrackerPermission
boolean userHasTrackerPermission(UserDto user, TrackerDto tracker, String... permissions)
Returns true, if the specified user has at least one of the specified tracker permissions (see table below) on the specified tracker, otherwise false
Codebeamer 9.2 and later
The groups parameters for the userInGroup, function, are the names of the following user groups:
User Group
Description
sysadmin
The system administrators group.
user
The regular user group.
There can be any number of additional user groups.
In most cases, it is more appropriate to check if a user has specific system permissions (that can be granted using different user groups). For example, instead of
userInGroup(user, "sysadmin")
use
userHasPermission(user, "system_admin")
The roles parameter for the userInRole function are the names of project roles.
Project Role
Description
Project Admin
The role for Project Administrators.
Developer
The role for (Software) Developers in the project.
Stakeholder
The role for Stakeholders in the project.
Product Owner
The role for Product Owners in the project.
Scrum Master
The role for Scrum Masters in the project.
Test Lead
The role for Test Lead(er)s in the project.
Test Engineer
The role for Test Engineers in the project.
Tester
The role for Testers in the project.
There can be any number of additional project roles.
Example: check if the current user has the role Developer or Tester in the current project:
userInRole(user, project, "Developer", "Tester")
In most cases, it is more appropriate to check if a user has a specific project permission (that can be granted via different project roles). For example, instead of
userInRole(user, project, "Project Admin")
use
userHasProjectPermission(user, project, "project_admin")
The permissions parameters for the userHasPermission function are the names of system permissions:
System Permission
Description
wiki_edit_own_page
Allows users to edit own Wiki pages.
account_admin_own
Allows users to administer own account data settings.
account_modify_own_timezone_dateformat
Allows users to administer own timezone and date format data settings.
account_admin
Allows users to administer all account data settings (name,e-mail,password, phone number, ...).
account_address_view
Allows users to view the address field in all accounts.
account_company_view
Allows users to view the company field in all accounts.
account_phone_view
Allows users to view the phone field in all accounts.
account_email_view
Allows users to view the email field in all accounts.
account_skills_view
Allows users to view the skill field in all accounts.
account_role_view
Allows users to view user group settings and members.
account_role_admin
Allows users to create, administer user groups and assign members.
document_add_global
Allows users to add new project-independent documents.
label_public_create
Allows users to create new public tags.
label_public_admin
Allows users to administer public tags.
system_project_create
Allows users to create a new project.
system_admin
Allows users to administer the portal.
service_desk
Allows users to access the Service Desk.
queries_view
Allows users to access Queries.
review
Allows users to do Reviews.
api_permission
Allows user to access to the Rest / Remote API.
only_api_permission
If set, users in groups with this permission cannot use the GUI.
System permissions are granted to user groups and indirectly to all users in that groups.
The permissions parameters for the userHasProjectPermission function are the names of project permissions:
Project Permission
Description
wiki_space_view
Allows users access to the project Wiki.
document_view
Allows users access to the project "Documents".
document_view_history
Allows users to view the document version history.
document_add
Allows users to add new documents to a project.
document_unpack
Allows users to upload and unpack Zip and Tar files.
document_subscribe
Allows users to subscribe documents to get email notifications when a document is read or modified by an other user
document_subscribe_others
Allows users to subscribe documents for project members to get email notifications when a document is read or modified by an other user.
document_subscribers_view
Allows users to view the subscriber list.
tracker_view
Allows users to view tracker list and the "Trackers" tab.
tracker_admin
Allows users to administer project trackers, set permissions, add custom fields, set default fields, and so on.
tracker_report
Allows users to access and execute reports.
cmdb_view
Allows users to view the project CMDB.
cmdb_admin
Allows users to administer the project CMDB, create categories, set permissions, add custom fields, set default fields, and so on.
branch_view
Allows users to view branches.
branch_admin
Allows users to administer tracker branches.
baseline_view
Allows users to view baselines.
baseline_admin
Allows users to administer project baselines.
scm_view
Allows users to view the repository hierarchy in this project, even if they don't have access to any of the repositories.
scm_admin
Allows users to create new top-level repositories in this project, and to update or delete any existing one.
members_view
Allows users to view project members.
members_admin
Allows users to administer project members.
member_role_view
Allows users to view project role permission settings.
project_admin
Allows users to administer all project settings.
Project permissions are granted to project roles and indirectly to all project members with that roles.
The permissions parameters for the userHasTrackerPermission function are the names of tracker permissions:
Tracker Permission
Description
issue_add
Allows users to create new items in a tracker.
issue_view
Allows users to see own items in a tracker.
issue_view_not_own
Allows users to see all items in a tracker.
issue_edit
Allows users to edit own items in a tracker.
issue_edit_not_own
Allows users to edit any items in a tracker.
issue_mass_edit
Allows users to mass edit multiple items in a tracker.
issue_close
Allows users to close items in a tracker.
issue_delete
Allows users to delete items in a tracker.
issue_history_view
Allows users to see the history of items in a tracker.
issue_escalation_view
Allows users to view issue escalation schedules in a tracker.
issue_attachment_view
Allows users to view issue comments or attachments in a tracker.
issue_comment_add
Allows users to add comments to issues in a tracker.
issue_attachment_add
Allows users to add attachments to issues in a tracker.
issue_attachment_edit
Allows users to edit/delete any issue comments or attachments in a tracker.
issue_attachment_edit_own
Allows users to edit/delete own issue comments or attachments in a tracker.
issue_subscribe
Allows users to subscribe notifications on a single tracker item.
issue_subscribe_others
Allows users to manage subscriptions of other users for notifications on a single tracker item.
tracker_subscribe
Allows users to subscribe notifications on the whole tracker.
tracker_subscribe_others
Allows users to manage subscriptions of other users for notifications on the whole tracker.
tracker_subscribers_view
Allows users to view subscriptions of other users for notifications on the whole tracker.
admin_public_view
Allows users to administrate (create, update and delete) public views on the tracker.
issue_association_view
Allows users to see tracker item associations.
issue_association_edit
Allows users to edit (create, update and delete) tracker item associations.
issue_suspected_merge
Allows to merge tracker item.
branch_merge
Allows to merge branches.
Tracker permissions are granted to project roles via Tracker > Configure > Permissions, and so indirectly to all project members in that roles.
Was this helpful?