I have an user which has the following custom user claims,
customClaims: { role: 'admin' },
How can I access this role property (admin) inside the cloud firestore rules?
I'm using the code below, which doesn't work. What needs to be done in order to work?
match /companies/{document=**} {
allow read: if request.auth != null;
allow write: if request.auth != null && request.customClaims.role == "admin";
}
getIdTokenResult(true)
provides my all claims but still can not able to access that claims in rules can anyone help me out – Reliquary