Compare requesting users uid to admins uid

Viewed 19

So I'm trying to write some firebase rules for my realtime database. I want my admin to be the only person/account that can edit an object in my database.

I've so far tried:

"Calender": {
  ".read": true,
  "$user_id": {
    ".write": "$user_id === 'admins uid here, copied from firebase console'",
  }
}

But as soon as I "set" to the database, I get the following warning, even if I'm logged in as the admin:

FIREBASE WARNING: set at /Calender failed: permission_denied

How do I compare if the user is an admin based on the requesting users uid?

0 Answers
Related