You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Filip Lauc edited this page Jan 3, 2020
·
2 revisions
Although most Firestore rules you will be able to control through the module setup, some might need specific adjustments in firestore.rules. For example, if a collection needs to be readable publicly in addition to the wildcard collection selector:
match /modules/{module=**} {
allow read: if request.auth.uid != null;
allow write: if request.auth.token.role == 'admin';
}
You might add:
match /my-collection/{item} {
allow read: if true;
allow write: if access(database, 'users', 'write')
}
This states that my-collection can be read by anyone and wrote to by users that have write access for this collection configured in the dashboard.