check id on update (#393)

This commit is contained in:
TrueMilli 2022-06-02 01:30:36 +02:00 committed by GitHub
parent 78a359407d
commit c2f993ddf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,7 +45,8 @@ service cloud.firestore {
match /contracts/{contractId} {
allow read;
allow update: if request.resource.data.diff(resource.data).affectedKeys()
.hasOnly(['description', 'closeTime', 'tags', 'lowercaseTags']);
.hasOnly(['description', 'closeTime', 'tags', 'lowercaseTags'])
&& resource.data.id == request.auth.uid;
allow update: if isAdmin();
}