通过firebaseRef.set更新firebase安全规则

时间:2013-09-17 01:51:52

标签: javascript firebase

我可以通过

读写安全规则吗?
var firebaseRef = new Firebase('https://YOUR_FIREBASE.firebaseio.com/.settings/rules');
firebaseRef.set(rulesJson);

1 个答案:

答案 0 :(得分:4)

不,但您可以使用REST API来读取或编写安全规则:https://www.firebase.com/docs/rest-api.html

curl https://SampleChat.firebaseio-demo.com/.settings/rules.json?auth=FIREBASE_SECRET
curl -X PUT -d '{ "rules": { ".read": true } }' https://SampleChat.firebaseio-demo.com/.settings/rules.json?auth=FIREBASE_SECRET