I want to investigate that the user is admin or not but this is not working.
I get an error:
You don't have a permission to acces the object
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /articles/{allPaths=**} {
allow read;
allow create: if firestore.get(/databases/{database}/documents/users/$(request.auth.uid)).data.isAdmin == true;
allow update;
}
}
}
I try to rewrite the code, but this is not working too:
allow create: if firestore.get(/databases/{database}/documents/users/$(request.auth.uid)).isAdmin == true;