RULES FILES
{
"rules": {
".write": true,
"users": {
".validate": "newData.hasChildren(['uuid', 'on'])",
"on": {
".validate": "newData.isNumber() &&
newData.val() >= 0 &&
newData.val() <= 1"
},
"uuid": {
}
}
}
}
this is my code (node.js).
firebase.initializeApp({
serviceAccount: "BITCOIN-f9a190c06e27.json",
databaseURL: "https://bitcoin-865ac.firebaseio.com"
});
var users = firebase.database().ref('/users')
users.set({
uuid: 'xxxx',
on: '0'
});
I have this mistake.
FIREBASE WARNING: set at /users failed: permission_denied (node:444) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: PERMISSION_DENIED: Permission denied
i dont have any idea, i thought the write "true", was enough to give any permissions