Skip to content
This repository has been archived by the owner on Aug 17, 2024. It is now read-only.

Commit

Permalink
🐛 fix rules for talks
Browse files Browse the repository at this point in the history
  • Loading branch information
bpetetot committed Jul 15, 2019
1 parent 5a32ef1 commit 779df5b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config/firestore.rules
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down Expand Up @@ -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();
}
}
Expand Down

0 comments on commit 779df5b

Please sign in to comment.