Search code examples
androidiosfirebasefirebase-realtime-databasefirebase-security

Firebase data for all users without authorizing


Is it possible to create some parts of data available for users like list of shop products without authorizing but only authorized users can change the information about products or create new ones?


Solution

  • you can do it, just declare following rules at that specific location

    {
      "rules": {
        "Products":{
          ".read": "true",
        ".write": "auth.uid!=null"
        }
    
      }
    }
    

    only authurized users can write data.