In current project I have Roles
and Permissions
. Obviously, Permissions
can be assigned to Roles
.
To assign a bulk of Permissions
to a Role
with id 1, I use the following method:
POST /roles/1/permissions (RequestBody: List of permissions)
In the same way, I would remove a bulk of permissions at once:
DELETE /roles/1/permissions (RequestBody: List of permissions)
(I'm not sure if this is valid at all, as a DELETE request should not contain a request body.)
Now I would like to have a way to clear all permissions of a role. Logically I would use:
DELETE /roles/1/permissions
But this seems to interfere with the way I remove a bulk of permissions. Or is the nonexistent of a request body already enough to distinct two methods?