Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions firestore/firestore.rules
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ rules_version = '2';
allow get: if canViewLoi(getSurvey(surveyId), resource.data);
// Allow all survey users to list LOIs.
allow list: if canViewSurvey(getSurvey(surveyId));
// Allow if user is owner of the existing LOI or can manage survey.
allow update, delete: if isLoiOwner(resource.data) || canManageSurvey(getSurvey(surveyId));
// Allow if user is owner of the existing LOI and can collect data, or can manage survey.
allow update, delete: if (isLoiOwner(resource.data) && canCollectData(getSurvey(surveyId))) || canManageSurvey(getSurvey(surveyId));
}

// Apply survey-level permissions to submission documents.
Expand All @@ -194,8 +194,8 @@ rules_version = '2';
allow get: if canViewSubmission(getSurvey(surveyId), resource.data);
// Allow all survey users to list submissions.
allow list: if canViewSurvey(getSurvey(surveyId));
// Allow if user is owner of the existing submission or can manage survey.
allow update, delete: if isSubmissionOwner(resource.data) || canManageSurvey(getSurvey(surveyId));
// Allow if user is owner of the existing submission and can collect data, or can manage survey.
allow update, delete: if (isSubmissionOwner(resource.data) && canCollectData(getSurvey(surveyId))) || canManageSurvey(getSurvey(surveyId));
}

// Apply survey-level permissions to job documents.
Expand Down
Loading