Open gjanvier opened 2 years ago
For your case will be:
1) const adminDb = testEnv.authenticatedContext('admin', { "isAdmin": true }).firestore()
2) await assertSucceeds(adminDb.collection('users').get())
.get()
on specific collection need at least list
rule, see https://fireship.io/snippets/firestore-rules-recipes/
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