Last active
December 22, 2022 14:56
-
-
Save benixal/670014872d2600c04cce238f761d5a31 to your computer and use it in GitHub Desktop.
firestore rule : allow read, write only admin
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
rules_version = '2'; | |
service cloud.firestore { | |
match /databases/{database}/documents { | |
match /chats/{userId}/{document=**} { | |
allow read, write: if | |
( | |
userId == request.auth.uid | |
&& | |
( !("resource" in request) || !("admin" in request.resource.data) ) | |
) | |
|| | |
request.auth.uid == 'UID' | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment