Skip to content

Commit

Permalink
Fix rules indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-amisha-i committed Jan 10, 2025
1 parent 7150e04 commit e71d5ec
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions firestore.rules
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,14 @@ service cloud.firestore {
// For Groups Collection
match /groups/{groupId} {
allow read: if isAuthorized() &&
resource.data.members.hasAny([request.auth.uid]);
resource.data.members.hasAny([request.auth.uid]);

allow create: if isAuthorized() &&
isCurrentUser(request.resource.data.created_by);
isCurrentUser(request.resource.data.created_by);

allow update: if isAuthorized() &&
(resource.data.members.hasAny([request.auth.uid]) ||
(!resource.data.members.hasAny([request.auth.uid]) &&
request.resource.data.diff(resource.data).affectedKeys().hasOnly(["members"])
)
(!resource.data.members.hasAny([request.auth.uid]) &&
request.resource.data.diff(resource.data).affectedKeys().hasOnly(["members"])
)
|| request.resource.data.keys().hasAny(["updated_at", "updated_by"]);

Expand Down

0 comments on commit e71d5ec

Please sign in to comment.