Created
June 29, 2018 00:23
-
-
Save nkmrh/bd4d8852f066ba2d2f1ad5f86122c6b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service cloud.firestore { | |
match /databases/{database}/documents { | |
function isAuthenticated() { | |
return request.auth != null; | |
} | |
function isBannedUser(userID) { | |
return exists(/databases/$(database)/documents/bannedUser/$(userID)); | |
} | |
match /comment/{commentID} { | |
allow read: if isAuthenticated(); | |
allow write: if isAuthenticated() && | |
!isBannedUser(request.resource.data.userID); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment