I have a user node that looks like this:
name: "someone"
isAdmin: true
isDev: true
permissions:
shots: true
Ultimately, I would like to grant anyone who is an admin to read and write to anything.
but in the meantime, how do I check a users permissions and then grant access?
Something like so:
match /{document=**} {
allow write: if request.user.permissions.shots == true;
}
UPDATE:
I've gotten a little farther.
allow write: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.permissions.shots == true;
I feel like should work, because what is below does work:
allow write: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.name == 'someone';
UPDATE:
As I dig deeper the approach below seems like the correct direction, but still not working
allow write: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.permissions2.child('shots').val() == true;