File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ service cloud.firestore {
29
29
function doesNotChangeRole () {
30
30
return ! request .resource.data .diff (resource .data ).affectedKeys ().hasAny ([' role' ])
31
31
}
32
+ function doesNotChangeNextDigestAt () {
33
+ // Only admins/automatic processes should be able to change the
34
+ // email digest notification times
35
+ return ! request .resource.data .diff (resource .data ).affectedKeys ().hasAny ([' nextDigestAt' ])
36
+ }
32
37
// either the change doesn't include the public field,
33
38
// or the user is a base user (i.e. not an org)
34
39
function validPublicChange () {
@@ -47,7 +52,7 @@ service cloud.firestore {
47
52
48
53
// Allow users to make updates except to delete their profile or set the role field.
49
54
// Only admins can delete a user profile or set the user role field.
50
- allow update : if validUser () && doesNotChangeRole () && validPublicChange ()
55
+ allow update : if validUser () && doesNotChangeRole () && validPublicChange () && doesNotChangeNextDigestAt ()
51
56
}
52
57
// Allow querying publications individually or with a collection group.
53
58
match / {path =** }/ publishedTestimony/ {id } {
You can’t perform that action at this time.
0 commit comments