0
votes

in my Firebase application want to apply different RULES for different data.

ex: my data are

ContactUs
    -Ksdasda4sd
        name: "Ram"
        email: "[email protected]"
        message: "Hello how are u"
HotelLocation
    -Ksdaseeesd
        name: "Hotel Name"
        address: "Near Highway"
        city: "Bangalore"

without login ContactUs data can be read write by public,where HotelsLocations can be read and write after login only.

on this configuration both need authentication.

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

can is it possible

1

1 Answers

1
votes

This is the configuration.

{
  "rules": {
    "contactme" : {
      ".read": "auth != null",
      ".write": "true"
     },
    "HotelLocation" : {
      ".read": "auth != null",
      ".write": "auth != null"
     }

  }
}