我在我的实时数据库中创建了一个禁止用户列表,我想让他们无法登录,我知道我可以使用数据库规则,但我不知道如何,有人能帮助我吗?这是我的数据库结构:
/banned-users: /UserId1:True /UserId2:True
这些是我的数据库规则:
{ "rules": { ".read": true, ".write": true } }
im9ewurl1#
需要按如下方式引用其他路径中的数据:
{ "rules": { "thepath": { ".read": "root.child('banned-users').child(auth.uid).val() !== true" ".write": "root.child('banned-users').child(auth.uid).val() !== true" } } }
请注意,实际上您并没有“使他们无法登录”,因为this is not possible,但您阻止他们写入/阅读您的数据库。
1条答案
按热度按时间im9ewurl1#
需要按如下方式引用其他路径中的数据:
请注意,实际上您并没有“使他们无法登录”,因为this is not possible,但您阻止他们写入/阅读您的数据库。