diff --git a/firestore.rules b/firestore.rules index ea8cebdd..877dce84 100644 --- a/firestore.rules +++ b/firestore.rules @@ -48,14 +48,15 @@ service cloud.firestore { 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]) || + (!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"]); allow delete: if isAuthorized() && resource.data.members.hasAny([request.auth.uid]);