Fix reader file upload#15133
Open
samiat4911 wants to merge 1 commit into
Open
Conversation
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.
Description
This PR allows users with file add access to upload product tracking files on Engagement, Test, and Finding objects without requiring full edit access to those objects.
The previous behavior reused generic related-object permissions where file upload POST requests were treated like object edits. That blocked reader-style users from attaching supporting evidence files. The fix separates file permissions from generic related-object permissions and uses the existing
Product_Tracking_Files_*permission enum for API file endpoints.The Engagement, Test, and Finding file actions now use these file-specific permission classes instead of the broader related-object permission classes.
For the classic UI
manage_filespage, the PR keeps edit users on the existing full manage formset, but gives add-only users a separate formset that can upload new files without exposing existing-file delete controls.Results:
staticfiles.W004warning for/app/components/node_modules.TestRelatedObjectPermissionspassed: 39 tests, 17 skipped.Documentation
Please update any documentation when needed in the documentation folder)
Checklist
This checklist is for your information.
dev.dev.bugfixbranch.