skip to Main Content

I have Permission denied in Firebase Chat. Tried this but not working. I have tried in Realtime database

{
  "rules": {
    ".read": "true",
    ".write": "true",
  }
}

Loot at screenshot for detailed error

enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    I have fixed this with following code

    {
      "rules": {
        ".read": "now < 9963441200000",  // 2022-9-18
        ".write": "now < 9963441200000",  // 2022-9-18
      }
    }
    

  2. Boolean values don’t require quotation marks.

    {
      "rules": {
        ".read": true,
        ".write": true,
      }
    }
    

    In your own answer you used an expression that is evaluated, which does need the quotation marks. Writing "now < 9963441200000" is exactly the same as true, since now is a Unix Timestap which caps at 2147483647000 and will always be less than that value.

    Note that neither is a secure set of rules.

    The Realtime Database Security Rules section of the documentation goes into more detail.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search