add the ability to delete versions via the API#20143
Merged
Merged
Conversation
diox
reviewed
Jan 4, 2023
| response = self.client.delete(self.url) | ||
| assert response.status_code == 401 | ||
| assert not self.version.reload().deleted | ||
|
|
Member
There was a problem hiding this comment.
Please add a couple more tests
- Logged in user, not author (403)
- Logged in author, not owner (204, we allow any author just like devhub)
Member
There was a problem hiding this comment.
Also... a regular reviewer (without Addons:Edit but with listed review permission) shouldn't be allowed to delete versions. As this stands it looks like they would ? That's worth testing to be sure.
eviljeff
force-pushed
the
19784-delete-versions
branch
from
January 5, 2023 14:28
d258847 to
9c29ebb
Compare
eviljeff
force-pushed
the
19784-delete-versions
branch
from
January 5, 2023 14:29
9c29ebb to
26b212f
Compare
diox
approved these changes
Jan 5, 2023
Comment on lines
+3977
to
+3978
| # even if they are a reviewer | ||
| self.grant_permission(another_user, ':'.join(amo.permissions.ADDONS_EDIT)) |
Member
There was a problem hiding this comment.
It's nice to test ADDONS_EDIT but we should also test with something that satisfies acl.is_reviewer()
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.
fixes mozilla/addons#8891