Got feedback or spotted a mistake?
Leave a comment at the end of this page or email contact@krishagni.com
Retrieve User Roles
openspecimen/rest/ng/rbac/subjects/{userId}/roles
The API returns the list of roles assigned to the user identified by userId
on various sites and collection protocols.
Parameter | Details |
---|---|
userId | Unique ID assigned to every user by OpenSpecimen. |
Below is an example of the API call to retrieve user roles.
Method | URL |
---|---|
URL | openspecimen/rest/ng/rbac/subjects/1/roles |
Method | GET |
Request | application/json |
Response | [ { "id": 216, "role": { "id": 5, "name": "Tissue Banker", "description": "Tissue banker who registers participants and collects specimens.", "parentRoleName": null, "childRoles": [], "acl": [ { "id": 35, "resourceName": "SurgicalPathologyReport", "operations": [ { "operationName": "Delete" }, { "operationName": "Read" }, { "operationName": "Create" }, { "operationName": "Export Import" }, { "operationName": "Update" }, { "operationName": "Export Import" } ] }, { "id": 47, "resourceName": "StorageContainer", "operations": [ { "operationName": "Read" } ] }, { "id": 20, "resourceName": "CollectionProtocol", "operations": [ { "operationName": "Read" } ] }, /* Other resources and operations that can be performed on them */ ] }, "collectionProtocol": null, /* on all CPs of the site Apollo Hospitals */ "site": { "id": 14, "name": "AS3", "instituteName": "Apollo Hospitals", "code": "AS3", /* Other site info */ }, "systemRole": false }, /* More roles, if any */ ] |
Error Cases :
code | Applies to | Status Message |
---|---|---|
200 | All resources | Success |
400 | All requests | Permission issues or invalid parameters like incorrect user ID etc |
401 | All requests | Authorization failed. Requires login. |
500 | All requests | Server error |
Got feedback or spotted a mistake?
Leave a comment at the end of this page or email contact@krishagni.com