here is my structure data
sampleApp
items
- item1
- title: pizza
- price: 200/-
- item2
- title :burger
- price: 120/-
- item1
users
- user-1
- name: username
- email:[email protected]
- role
- admin: true
- user : true
- superuser: true
- user-2
- name: username2
- email: [email protected]
- role
- admin: false
- user: true
- superuser: false
- user-1
Here is my rules
rules{
".write": true,
"items":{
".read":"root.child(users).child(auth.uid).child(role).child(admin).val()===true"
}
}
My question is when user-1: " admin=true, user=true, superuser=true " total items child have to read. For another user-2: " admin=false, user=true, superuser=false " in this case only item1 has to read in items child.
How can I write the security rules for it?