June 2018
Beginner to intermediate
394 pages
9h 2m
English
Database rules are versatile and powerful and if we want to customize certain operations we can achieve it through rules. For instance, if we require giving access to read all the data and no write access to users, we can achieve this by using the following rules:
{"rules": {".read": true,".write": false}}
The preceding rules will allow the user to have a read access to the database. Since there isn't any path specified, the complete database is readable, but not writable. If we want to customize on node basis we can take the node name into the rules and we can give the rules as follows. Test the rules in the simulator before publishing them:
{"rules": {".write" : false,"Donor" : {".read" : true}}}
The following ...
Read now
Unlock full access