Create a Role
Create a new user role
Use the following operation to create a user role in Zephyr Enterprise.
POST flex/services/rest/v3/role
Request format
To create a user role, send a POST request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/v3/role
Request body
{ "name":"Administration Role", "description":null, "roleTemplateId":"1" }
The roleTemplateId
value specifies the level of permissions for certain applications in Zephyr. It can be either 1 (Administration Apps), or 2 (Project Apps).
Response body
#For Role Template 1 { "id" : 106, "name" : "Administration Role ", "hasManagerApp" : false, "deletable" : true, "editable" : true, "createdOn" : 1588062308198, "roleTemplate" : {"id" : 1,"templateName" : "Administration Apps","templateType" : 1, "templateApps" : "{ "apps": [ {"id":1,"name":"System Setup"}, {"id":2,"name":"User Setup"}, {"id":3,"name":"Project Setup"}, {"id":6,"name":"Defect Admin"}, {"id":32,"name":"Group Setup"} ] }", "editable" : true, "deletable" : true }, "isProjectAppRole" : false}
#For Role Template 2 { "id" : 107, "name" : "Project APP", "hasManagerApp" : false, "deletable" : true, "editable" : true, "createdOn" : 1588062577117, "roleTemplate" : { "id" : 2, "templateName" : "Project Apps","templateType" : 2,"templateApps" : " {"apps": [ {"id":8,"name":"Release Setup"}, {"id":9,"name":"Requirements"}, {"id":11,"name":"Test Planning"}, {"id":13,"name":"Reporting"}, {"id":15,"name":"Test Repository"}, {"id":16,"name":"Test Execution"}, {"id":17,"name":"Defect Tracking"}, {"id":20,"name":"Execute All Executions"} ] }", "editable" : true, "deletable" : true}, "isProjectAppRole" : true }
Assign a permission to the role
Use the following operation to assign a permission to the user role.
PUT /flex/services/rest/v3/role/permission?roleid={role ID}
Request format
To assign a permission to a user role, send a PUT request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/v3/role/permission?roleid={role ID}
role ID is the ID of the role of the Zephyr Enterprise user.
Request body (Administration Apps)
[ {"applicationName":1,"deleteable":false}, {"applicationName":2,"deleteable":false}, {"applicationName":3,"deleteable":false}, {"applicationName":6,"deleteable":false}, {"applicationName":32,"deleteable":false} ]
Request body (Project Apps)
[ {"applicationName":8,"deleteable":true}, {"applicationName":9,"deleteable":true}, {"applicationName":11,"deleteable":true}, {"applicationName":13,"deleteable":false}, {"applicationName":15,"deleteable":true,"readable":true,"editable":true}, {"applicationName":16,"deleteable":true}, {"applicationName":17,"deleteable":false}, {"applicationName":20,"deleteable":false} ]
The applicationName
value indicates the application that can be accessed by the user who has the specified role.
Possible values:
1
- System Setup
2
- User Setup
3
- Project Setup
6
- Defect Admin
8
- Release Setup
9
- Requirements
11
- Test Planning
13
- Reporting
15
- Test Repository
16
- Test Execution
17
- Defect Tracking
20
- Execute All Executions
32
- Group Setup