How to only allow one admin user to write Firebase Database?

前端 未结 1 1254
自闭症患者
自闭症患者 2020-12-05 16:01

I am trying to set up a Firebase database that only I can write. So no user will have permission to write anything. But everyone will be able to read it.

However, I

相关标签:
1条回答
  • 2020-12-05 16:32

    This should work:

    {
      "rules": {
        ".read": true,
        ".write": "auth.uid === 'dJrGShfgfd2'"
      }
    }
    

    Everyone in the world will be able to read the data, but only the user with UID dJrGShfgfd2 (and processes with administrative access) can write the data.

    0 讨论(0)
提交回复
热议问题