I've the follwing database:
actions : [ {
"added" : 1535293085383,
"countdown" : 9999999999,
"item" : 1,
"type" : "a"
}, {
"added" : 1535293085383,
"countdown" : 999999999,
"extra" : "bb",
"item" : "2",
"type" : "b"
}, {
"added" : 1635293085383,
"countdown" : 1,
"item" : 3,
"type" : "c"
}]
I want to any logged user be able to read all data, but ONLY WRITE THE COUNTDOWN NODE.
My idea is everytime users read the data decrement that value, but they are not allowed to update any other node
there are the rules i wrote
{
"rules":{
".read":false,
".write":false,
"actions":{
".indexOn":[
"added"
],
".read": "auth != null",
"countdown":{
".write" : "auth != null"
}
}
}
it is denying read from unauthenticated users
it is allowing to read from authenticated users
it is dennying to write from authenticated users EVEN in the countdown node
how can i fix it