feat: enable basic group crud operations#1189
Draft
keithmanville wants to merge 3 commits intodevfrom
Draft
Conversation
This commits adds basic group CRUD operations to the REST API:
- POST /api/v1/groups/
- PUT /api/v1/groups/{id}
- DELETE /api/v1/groups/{id}
By default, only the current user is added to a new group. The group is populated with the
built-in plugin parameter types.
The default user group (public) is protected from deletion or modification by any user.
Group deletion removes all members. The constraint for ensuring a user has at least one group is
maintained by preventing deletion of the public group that all users are part of.
This commit adds checks for all resource endpoints to ensure users cannot access, modify, or delete
resources they don't have the correct permissions for. There are not currently protections in place
to prevent users from deleting or renaming groups they are not a member of.
It makes use of the existing UserNotInGroupError when a user attempts to access a resource from a
group they do not belong to, and adds the UserPermissionsError for cases where a user is in the
group but doesn't have the proper permissions to perform an action.
It adds new tests to verify users can not get or delete resources belonging to a group they do not
access to. Modification and permissions checkes remain untested.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commits adds basic group CRUD operations to the REST API:
By default, only the current user is added to a new group. The group is populated with the built-in plugin parameter types.
The default user group (public) is protected from deletion or modification by any user.
Group deletion removes all members. The constraint for ensuring a user has at least one group is maintained by preventing deletion of the public group that all users are part of.
This commit adds checks for all resource endpoints to ensure users cannot access, modify, or delete resources they don't have the correct permissions for. There are not currently protections in place to prevent users from deleting or renaming groups they are not a member of.
It makes use of the existing UserNotInGroupError when a user attempts to access a resource from a group they do not belong to, and adds the UserPermissionsError for cases where a user is in the group but doesn't have the proper permissions to perform an action.
It adds new tests to verify users can not get or delete resources belonging to a group they do not access to. Modification and permissions checkes remain untested.
Some open questions: