New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow non-owners to remove themselves from a shared asset #2945
Merged
jnm
merged 7 commits into
beta
from
2940-allow-non-owners-to-remove-their-own-permissions
Jan 30, 2021
Merged
Allow non-owners to remove themselves from a shared asset #2945
jnm
merged 7 commits into
beta
from
2940-allow-non-owners-to-remove-their-own-permissions
Jan 30, 2021
Conversation
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
joshuaberetta
added
Back end
enhancement
Ideas, improvements and features
API
Changes related to API endpoints
labels
Jan 5, 2021
joshuaberetta
changed the title
[WIP] Allow non-owners to remove themselves from a shared asset
Allow non-owners to remove themselves from a shared asset
Jan 5, 2021
jnm
requested changes
Jan 12, 2021
* This change allows users with `view_asset` to permissions to remove themselves from an asset that has been shared with them
* The new condition ensures that if the user attempting to perform the delete is not the owner of the asset and is trying to delete permissions for anyone but themselves, a 'permission denied' error is raised.
* Ensuring that a non-owner can remove themselves from an asset shared with them * Ensuring that a non-owner who has been shared an asset cannot remove permissions of the owner of that asset * Ensuring that a one non-owner cannot remove the permissions of another non-owner who has also been shared the same asset
joshuaberetta
force-pushed
the
2940-allow-non-owners-to-remove-their-own-permissions
branch
from
January 21, 2021 20:06
c72f4e3
to
b12ef8f
Compare
…rs-to-remove-their-own-permissions
jnm
approved these changes
Jan 30, 2021
Comment on lines
+290
to
+292
perm = ObjectPermission.objects.filter(asset=new_asset).get( | ||
user=self.someuser, permission__codename=PERM_VIEW_ASSET | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…-to-remove-their-own-permissions
This was referenced Sep 9, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Permissions on the
DELETE
method of the existingpermission-assignments
endpoint have been modified to allow for non-owners of a shared asset to always be able to remove themselves from the asset:DELETE /api/v2/assets/{uid}/permission-assignments/{permission_uid}/
Non-owners can remove their own permissions, but are not able to delete the permissions of the asset's owner or any other non-owners who may have the asset shared with them.
Description
This change allows users with
view_asset
to permissions to remove themselves from an asset that has been shared with them as requested in the community forum.Related issues
closes #2940