diff --git a/firestore.rules b/firestore.rules index 9d10dc61..f758a19c 100644 --- a/firestore.rules +++ b/firestore.rules @@ -10,7 +10,8 @@ service cloud.firestore { match /contracts/{contractId} { allow read; - allow update: if resource.data.creatorId == request.auth.uid && request.resource.data.keys().hasOnly(["description"]); + allow update: if resource.data.creatorId == request.auth.uid && request.resource.data.diff(resource.data).affectedKeys() + .hasOnly(['description']); allow delete: if resource.data.creatorId == request.auth.uid; }