Authorize user-media writes at the survey level - #2576
Merged
rfontanarosa merged 2 commits intoJul 29, 2026
Merged
Conversation
gino-m
requested changes
Jul 27, 2026
| // Only the owning user with permission to contribute data to the survey can create/update media. | ||
| allow create, write: if isResourceOwner(userId) && canCollectData(surveyId); | ||
| // Only users with permission to contribute data to the survey can create/update media. | ||
| allow create, write: if canCollectData(surveyId); |
Collaborator
There was a problem hiding this comment.
Shouldn't "write" only be for resources owners and survey organizers? Otherwise anyone can overwrite anyone elses' images?
Collaborator
Author
There was a problem hiding this comment.
we have a problem.
the resource owner is not saved anywhere. the path is /user-media/surveys/XXX/submissions/{taskId}-{uuid} and there is no metadata on it.
this change just reverts to the previous state, i've open a ticket related to this: #2578
…ected-by-storage-rules
gino-m
approved these changes
Jul 29, 2026
rfontanarosa
deleted the
rfontanarosa/2573/survey-media-uploads-rejected-by-storage-rules
branch
July 29, 2026 16:28
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.
closes #2573