We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In unit-test-security-rules-v9, show should I test an allow list rule, like in this example of firestore rules:
allow list
match /users/{userId}/{allPaths=**} { allow list: if request.auth.token.isAdmin; }
In my use-case, I want to allow users to get their own info but only admins can list everybody.
get
list
Thanks
The text was updated successfully, but these errors were encountered:
For your case will be:
const adminDb = testEnv.authenticatedContext('admin', { "isAdmin": true }).firestore()
await assertSucceeds(adminDb.collection('users').get())
.get() on specific collection need at least list rule, see https://fireship.io/snippets/firestore-rules-recipes/
.get()
Sorry, something went wrong.
No branches or pull requests
In unit-test-security-rules-v9, show should I test an
allow list
rule, like in this example of firestore rules:In my use-case, I want to allow users to
get
their own info but only admins canlist
everybody.Thanks
The text was updated successfully, but these errors were encountered: