-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
409 if a conflicting membership already exists
Change the add-group-membership API to return a 409 Conflict if a conflicting membership (one with the same user and group but different roles) already exists in the DB: POST /api/groups/{groupid}/members/{userid} {"roles": ["owner"]} -> 200 OK POST /api/groups/{groupid}/members/{userid} {"roles": ["admin"]} -> 409 Conflict Previously this would have resulted in a 200 OK even though the membership's role in the DB would *not* have been updated with the new role from the second request. For backwards-compatibility it will still respond 200 OK if the subsequent request's role *does* match the existing role in the DB: POST /api/groups/{groupid}/members/{userid} {"roles": ["owner"]} -> 200 OK POST /api/groups/{groupid}/members/{userid} {"roles": ["owner"]} -> 200 OK This also works if requests are made with no JSON body (which creates memberships with the default role of "member"): POST /api/groups/{groupid}/members/{userid} (no body content) -> 200 OK POST /api/groups/{groupid}/members/{userid} (no body content) -> 200 OK
- Loading branch information
Showing
5 changed files
with
84 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters