Created
October 4, 2017 04:24
-
-
Save SUPERCILEX/cd9902ccaa5d448baa9c6830a26ab6fd to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { | |
// Incorrect solution | |
match /public/{doc=**} { | |
allow read; | |
match /foo/{bar} { | |
allow write: if doc == "foobar"; // Error! "doc" is a path object, not a string | |
} | |
} | |
// Correct solution | |
match /public/{doc} { | |
allow read; | |
match /foo/{bar} { | |
allow read; | |
allow write: if doc == "foobar"; // Correct, "doc" is now the document id | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment