From 779df5b47b07bd8d78d5902145f0cc401121433e Mon Sep 17 00:00:00 2001 From: Benjamin Petetot Date: Mon, 15 Jul 2019 22:57:56 +0200 Subject: [PATCH] :bug: fix rules for talks --- config/firestore.rules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/firestore.rules b/config/firestore.rules index 5495f975a..d75750efd 100644 --- a/config/firestore.rules +++ b/config/firestore.rules @@ -16,7 +16,7 @@ service cloud.firestore { return eventRes.data.owner == request.auth.uid || get(/databases/$(database)/documents/organizations/$(eventRes.data.organization)).data.members[request.auth.uid] == true } function itsMyMessage(message) { return request.auth.uid == message.data.uid } - + function itsMySurvey() { return request.path[6] == request.auth.uid } function hasInviteCode() { return request.resource.id == resource.id } @@ -78,10 +78,10 @@ service cloud.firestore { // TALKS match /talks/{talk} { - allow get: if authenticated(); // invite ? + allow get: if authenticated() && itsMyTalk(); allow list: if authenticated() && itsMyTalk(); allow create: if authenticated(); - allow update: if authenticated() && (itsMyTalk() || hasInviteCode()); + allow update: if authenticated() && itsMyTalk(); allow delete: if authenticated() && itsMyTalk(); } }