目前我有点困惑,因为我的规则不像我想的那样工作......
我的结构:
{
"news" : {
"firstNew" : {
"comments" : {
"firstComment" : {
"date" : "2017.03.22.",
"text" : "első comment!",
"user" : {
"email" : "[email protected]",
"uid" : "blabla"
}
},
"secondComment" : {
"text" : "second comment",
"user" : {
"email" : "[email protected]",
"uid" : "alma"
}
}
},
"content" : {
"text" : "Itt sok sok sok sok sok sok sok sok szöveg lesz, nagyon sok szöveg meg mindenféle",
"title" : "Az első hír az oldalon"
}
}
},
"users" : {
"user1" : {
"email" : "[email protected]",
"roles" : {
"administrator" : true
}
}
}
}
这是我的规则:
{
"rules": {
"news":{
".read": true,
"content":{
".write": "root.child('users').child(auth.uid).child('roles').child('administrator').val() === true"
},
"comments":{
"$comment": {
".write": true
}
}
}
}
}
我就是不会写评论!我正在尝试模拟它,通过身份验证,并使用良好的“uid”。我正在尝试这个:news/firstNew/comments/secondComment with uid: alma
请帮助我,我做错了什么?
我在规则中错过了我的结构级别。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句