...
Code | Message | Description |
---|---|---|
200 | - | The session has been created and can be used. |
400 | createSession takes exactly three parameters: session ID as url parameter, userid as MUST (in body) and an array of roles as MAY (in body) | You have not given all MUST parameters. |
401 | - | You have to authorize authorise to use this URL. |
404 | The user is not known | The user cannot be found in the system so you cannot create a session for this user. |
406 | The session allready exists so you can not create it | The session-ID already exists and cannot be used to create another session. |
409 | This user-role-combination is invalid | You specified roles that the user may not activate. |
500 | various | Anything else went wrong. |
...
Value | Description | |
---|---|---|
URL | /users/{userid} | The userid is the user's UUID. |
HTTP-Method | GET | |
Body | ||
Return value | 200 / JSON | A JSON string containing the userid and a list of all the roles the user is assigned to as well as a list of roles the user has authorization for. (This may vary if you use hierarchical roles as a user is authorized authorised for all parent roles of the roles he is assigned to.) |
...
Step | Call | Description | Return | ||||
---|---|---|---|---|---|---|---|
1 |
| Create the user "joe" | 200 | ||||
2 |
| Create two roles "BasicUser" and "Admin" | 200 | ||||
3 |
| Create the resource "front_door" that knows the operations "open" and "close" | 200 | ||||
4 |
| Assign the user with the UUID "9957a0a0-998b-11e8-895e-4ccc6a0a4596" to the role "BasicUser" | 200 | ||||
5 |
| Permit the operation "open" on "front_door" for the "Admin" role and the operation "close" on "front_door" for the "BasicUser" role | 200 | ||||
6 |
| Initialize Initialise a new session for the user with the UUID "9957a0a0-998b-11e8-895e-4ccc6a0a4596" and activate the role "BasicUser". | 200 | ||||
7 |
| Check if the session "899cd8d1-72dc-4600-82c3-e91c21eb08ee" that belongs to the user with the UUID "9957a0a0-998b-11e8-895e-4ccc6a0a4596" is allowed to "open" the "front_door" | 403 | ||||
8 |
| Check if the session "899cd8d1-72dc-4600-82c3-e91c21eb08ee" that belongs to the user with the UUID "9957a0a0-998b-11e8-895e-4ccc6a0a4596" is allowed to "close" the "front_door" | 200 |
...