List members
Who has which permissions on
folder
Foo?
Listing members shows all subjects or groups that are assigned as members to a resource. This operation only shows direct assignments. In a multi-level hierarchy, it does not show implicit members.
The list members operation is useful to show who can access a resource in the user interface or to list all members of a tenant.
Flow
Scenario: In your Frontend, user Bob is logged in and you want to display all users, that have access to folder Foo.
➊ Your Frontend, requests at Space Blocks directly, to add list of all members of folder
Foo
➋ Space Blocks verifies Bob’s permissions to list the members and returns a list of all members
For communicating directly with Space Blocks, your Frontend needs an impersonated Access Token, with should be issued by your backend.
Usage
- API
To list members of a resource, we use the GetResourceMembers API endpoint of that resource or the whole tenant.
/tenants/<TENANT_ID>/resources/<RESOURCE_ID>/members
/tenants/<TENANT_ID>/members
Examples:
/tenants/456/resources/123/members
/tenants/456/members
Request:
curl -i --location https://<YOUR_API_URL>/management/tenants/<TENANT_ID>/permissions/check?resourceType=<RESOURCE_TYPE>&resourceId=<RESOURCE_ID>&permissionScope=<PERMISSION_SCOPE>&permission=<PERMISSION_SLUG>&permission=<PERMISSION_SLUG>&subjectId=<SUBJECT_ID> \
--header "Content-Type: application/json" \
--header "Authentication: Bearer <YOUR_ACCESS_TOKEN>" \
--header "apiKey: <YOUR_API_KEY>"
Example Response:
{
"subjects": {
"<SUBJECT_ID>": "<ROLE_ID>",
"abc": "reader"
},
"groups": {
"<GROUP_ID>": "<ROLE_ID>",
"administrators": "admin"
}
}