Created
March 1, 2020 20:37
-
-
Save hiranya911/87c0b886d19edbef1072a53fcee600be 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 { | |
match /users/{uid} { | |
allow write: if request.resource.data.age >= 18 | |
&& request.resource.data.email.matches('.+@.+') | |
&& request.resource.data.screenName is string | |
&& get(/databases/$(database)/documents/screenNames/$(request.resource.data.screenName)).data.uid == uid | |
&& exists(request.resource.data.company); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment