Reputation: 11
How can i restrict database to make any new nodes(from an app) in the database using firebase rules.
Upvotes: 1
Views: 153
Reputation: 2456
I hope you have wrote rule for all the existing nodes in database, after that write the following rule for preventing creation of new nodes from android app or any other integration
"rules": {
"Articles": {
".read": //rules that you want to write
".write": //rules that you want to write
}
"Categories": {
".read": //rules that you want to write
".write": //rules that you want to write
}
.
.
//rules for other nodes in your database
.
.
"$NewNode":{
//This rule will prevent from creating new nodes
".read": false,
".write": false
}
}
}
Upvotes: 1