{
"rules": {
"users": {
"$uid":{
//Private whatever under "uid" but Public is exposed
".read": "auth != null && auth.uid == $uid",
".write": "auth != null && auth.uid == $uid",
"public": { ".read": "auth != null" }
}
}
}
}
- 我创建这些规则,让用户公/私轮廓
- “用户/{} UID/公共”轮廓应该是那些被认证的任何用户访问,但在“用户/ UID”
这里不能访问的数据存储在我的火力点数据库中的一些假数据。如何使用Firebase安全规则创建公/私用户配置文件?
{
"users" : {
"YFIIAgwa2kaannrXjwvSZmoywma2" : {
"Name:" : "Example 1",
//This public child should be accessible by
//"Example 2" but cannot know the name of
// this user
"public" : {
"email" : "[email protected]"
}
},
"YgSfSzPzxLbyDL17r6P9id2cdvH2" : {
"Name:" : "Example 2",
//This public child should be accessible by
//"Example 1" but cannot know the name of
// this user
"public" : {
"email" : "[email protected]"
}
}
}
}
我想知道这是否是防止任何用户访问用户重要信息的可靠方法!无论如何,我可以通过验证来改善这一点吗?我很乐意接受你们的建议。我想为我的应用程序创建最佳和简单的安全规则。
请拼写您的标题。 – 2016-08-12 17:04:56