Refactor Role API
Current Situation
To create a role assignment you POST /api/role/{group_id}/ json_body={scope_type, scope_id, role}
New requirements
- We want to be able to get all the role assignments for a specific
group
andscope
. - We want to be able to batch create many role assignments
Immediate Suggestions
- Lets rename
/api/role/
->/api/role_assignments/
from @peter_baserow
Options for the new endpoints
1) Use Query Parameters with the existing URL structure
GET /api/role/{group_id}/?scope_type=database&scope_id=10
POST /api/role/{group_id}/
POST /api/role/{group_id}/batch/
-
scope_type
andscope_id
are mandatory for now, in the future they become optional and the endpoint can list more role assignments
GET
and old/new POST
endpoints to have path params
2) Change both the new GET /api/role/{group_id}/{scope_type}/{scope_id}/
POST /api/role/{group_id}/{scope_type}/{scope_id}/
POST /api/role/{group_id}/{scope_type}/{scope_id}/batch/