From 7f926279034f95fed36a368db6d7c5e7b620733f Mon Sep 17 00:00:00 2001 From: Marcell Guilherme Costa da Silva Date: Mon, 30 Oct 2023 15:45:42 -0300 Subject: [PATCH] Update firestore.rules --- firestore.rules | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/firestore.rules b/firestore.rules index 7afa9a7..65c432b 100644 --- a/firestore.rules +++ b/firestore.rules @@ -2,18 +2,18 @@ rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /session/{document=**} { - allow read, write: if - request.auth.uid != null; + allow read, write: if + request.auth.uid != null; } - match /calls/{callId}/users/{document=**} { - allow create: if - request.auth.uid != null && request.auth.uid == request.resource.data.userUid; + match /calls/{callId}/users/{document=**} { + allow create: if + request.auth.uid != null && request.auth.uid == request.resource.data.userUid; allow read, list: if request.auth.uid != null; allow update: if - request.auth.uid != null && get(/databases/$(database)/documents/calls/$(callId)).data.hostId == request.auth.uid; + request.auth.uid != null && get(/databases/$(database)/documents/calls/$(callId)).data.hostId == request.auth.uid; allow delete: if - request.auth.uid != null && (get(/databases/$(database)/documents/calls/$(callId)).data.hostId == request.auth.uid || request.auth.uid == resource.data.userUid); + request.auth.uid != null && (get(/databases/$(database)/documents/calls/$(callId)).data.hostId == request.auth.uid || request.auth.uid == resource.data.userUid); } match /calls/{callId}/p2p-descriptions/{descriptionId} { allow create, update, delete: if @@ -22,12 +22,12 @@ service cloud.firestore { request.auth.uid != null } match /calls/{document} { - allow read: if - request.auth.uid != null; + allow read: if + request.auth.uid != null; allow create: if request.auth.uid != null && request.auth.uid == request.resource.data.hostId; - allow update, delete: if - request.auth.uid != null && request.auth.uid == resource.data.hostId; + allow update, delete: if + request.auth.uid != null && request.auth.uid == resource.data.hostId; } } -} \ No newline at end of file +}