【发布时间】:2016-12-02 14:06:54
【问题描述】:
在我的 iOS 应用程序中,用户创建了一个与 Twitter 用户名具有相似特征的用户名。一旦被识别为唯一的,它就会通过带有以下签名的 updateChildValues 持久化到数据库中:(在示例中,用户名为 JogBloggs)。
["usernames/": ["joebloggs: \(user.uid)"]]
在我的 fb 数据库的安全规则中,我想创建一个规则来确保上传的 uid 与当前用户的 uid 相同。我如何键入安全规则来确保这一点?我在下面的尝试不起作用。
"root.child('usernames').child(newData.val()).val() == auth.uid"
我的数据库中有以下结构
与这些规则相关联:
干杯
【问题讨论】:
标签: json firebase firebase-realtime-database firebase-security