SPC-140 Allow collaborators to delete themselves #52
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.
Description
Avenir would like collaborators to be able to delete themselves. This Pr adds a chained auth function that checks if someone is trying to delete themselves as a collaborator on a dataset. If they are, the auth check passes.
A small push back on this - the only way of undoing the action is to have the dataset re-shared with the individual. I suspect that an ideal engineering solution to this problem would actually maintain a seperate list of rejected shares (or alternatively think of them as "hidden shares"). So that the user can undo the decision without bothering the dataset creator if they so choose. That way you preserve the integrity of the list of collaborators being "the list of people the dataset owner is happy to share the data with".
But I appreciate this may be more work and complexity than it is worth.
Testing
A test is included for this new feature.
Documentation
Small updates have been made to the API documentation here.
Checklist
Put an
x
in the boxes that apply to this pull request (you can also fill these out after opening the pull request).You may not need to check all boxes.