/auth/v1/roles/<role_ID>: DELETE
Removes the role that is assigned to a user, group, collection, or domain.
The following table shows which roles can access this REST API endpoint:
Data admin | Data user | Collection Admin | Admin | Service user |
---|---|---|---|---|
Χ | Χ | ✓ | ✓ | Χ |
Synopsis of the request URL
curl -k -H ‘Authorization: Bearer <token>’ -X DELETE https://<spectrum_discover_host>/auth/v1/
roles/<role_ID> -d ‘<the component for which the role must be revoked >’
You can specify one of the following items for which you need to revoke the role:
- user_id
- group_id
- collection_id
- domain_id
Supported request types and response formats
Supported request types:
- DELETE
- JSON
Examples
Example 1: Revoking role from a user.
Request:
curl -k -H 'Content-Type: application/json' -H ‘Authorization: Bearer <token>’ -X DELETE
https://<spectrum_discover_host>/auth/v1/roles/4a5415cb9cc5460aafe12a6f6206448e
-d ‘{"user_id": "5b3cd6af1c38479aa3a8cb220230c651"}’
Response:
204 No Content
Example 2: Revoking role from a group.
Request:
curl -k -H 'Content-Type: application/json' -H ‘Authorization: Bearer <token>’ -X DELETE
https://<spectrum_discover_host>/auth/v1/roles/4a5415cb9cc5460aafe12a6f6206448e
-d ‘{"group_id": "6c4de7af1c38479aa3a8cb220230d762"}’
Response:
204 No Content
Example 3: Revoking role for a user of a collection.
Request:
curl -k -H 'Content-Type: application/json' -H ‘Authorization: Bearer <token>’ -X DELET
https://<spectrum_discover_host>/auth/v1/roles/4a5415cb9cc5460aafe12a6f6206448e
-d ‘{"user_id": "5b3cd6af1c38479aa3a8cb220230c651", “collection_id”: “c38479aa35b3cd6af1a8cb220230c651”}’
Response:
204 No Content
Example 4: Revoking role for a group of a domain.
Request:
curl -k -H 'Content-Type: application/json' -H ‘Authorization: Bearer <token>’ -X DELETE
https://<spectrum_discover_host>/auth/v1/roles/4a5415cb9cc5460aafe12a6f6206448e
-d ‘{"user_id": "5b3cd6af1c38479aa3a8cb220230c651", “domain_id”: “af1c38479a5b3cd6c651a3a8cb220230”}’
Response:
204 No Content