2023-02-20 09:49:05 +05:45
|
|
|
Feature: assign role
|
|
|
|
|
As an admin,
|
|
|
|
|
I want to assign roles to users.
|
|
|
|
|
So that users without an admin role cannot get the list of roles, assignments list and assign roles to users
|
|
|
|
|
|
2024-07-18 16:17:52 +05:45
|
|
|
Background:
|
2024-11-29 09:39:21 +05:45
|
|
|
Given user "Alice" has been created with default attributes
|
2024-07-18 16:17:52 +05:45
|
|
|
|
|
|
|
|
|
|
|
|
|
Scenario Outline: get assigned role of a user
|
|
|
|
|
Given the administrator has assigned the role "<user-role>" to user "Alice" using the Graph API
|
2023-02-20 09:49:05 +05:45
|
|
|
When the administrator retrieves the assigned role of user "Alice" using the Graph API
|
|
|
|
|
Then the HTTP status code should be "200"
|
2024-03-19 09:49:58 +05:45
|
|
|
And the Graph API response should have the role "<user-role>"
|
2023-02-20 09:49:05 +05:45
|
|
|
Examples:
|
2024-03-19 09:49:58 +05:45
|
|
|
| user-role |
|
2023-02-20 09:49:05 +05:45
|
|
|
| Admin |
|
|
|
|
|
| Space Admin |
|
|
|
|
|
| User |
|
2023-06-06 16:03:43 +02:00
|
|
|
| User Light |
|
2023-02-20 09:49:05 +05:45
|
|
|
|
2023-03-03 09:17:34 +05:45
|
|
|
|
2024-07-18 16:17:52 +05:45
|
|
|
Scenario Outline: get role of a user assigned via setting api
|
|
|
|
|
Given the administrator has given "Alice" the role "<user-role>" using the settings api
|
2023-03-03 09:17:34 +05:45
|
|
|
When the administrator retrieves the assigned role of user "Alice" using the Graph API
|
|
|
|
|
Then the HTTP status code should be "200"
|
2024-03-19 09:49:58 +05:45
|
|
|
And the Graph API response should have the role "<user-role>"
|
2023-03-03 09:17:34 +05:45
|
|
|
Examples:
|
2024-03-19 09:49:58 +05:45
|
|
|
| user-role |
|
2023-03-03 09:17:34 +05:45
|
|
|
| Admin |
|
|
|
|
|
| Space Admin |
|
|
|
|
|
| User |
|
2023-06-06 16:03:43 +02:00
|
|
|
| User Light |
|
2024-07-18 16:17:52 +05:45
|
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: non-admin user tries to get assigned role of another user
|
2024-11-29 09:39:21 +05:45
|
|
|
Given user "Brian" has been created with default attributes
|
2024-07-18 16:17:52 +05:45
|
|
|
When user "Alice" tries to get the assigned role of user "Brian" using the Graph API
|
|
|
|
|
Then the HTTP status code should be "403"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: non-admin user tries to get assigned role of nonexistent user
|
2024-11-29 09:39:21 +05:45
|
|
|
Given user "Brian" has been created with default attributes
|
2024-07-18 16:17:52 +05:45
|
|
|
When user "Alice" tries to get the assigned role of user "nonexistent" using the Graph API
|
|
|
|
|
Then the HTTP status code should be "403"
|