【问题标题】:Error in syntax on Firebase database rulesFirebase 数据库规则的语法错误
【发布时间】:2016-11-30 23:06:19
【问题描述】:
{
    "rules": {
        "Users": {
            "$user_id": {
                // Grants write access to the owner of this user account
                // whose uid must exactly match the key ($user_id)
                ".write": "$user_id === auth.uid"
            }
        }
        "$businessName": {
            ".write": "root.child('Users').child(auth.uid).child($businessName).child('Permission    s').val() === 'MODERATOR'"
        }
    }
}

这给了我一个错误:

保存规则时出错 - 第 10 行:应为 ',' 或 '}'。

错误提示我由于某种原因缺少括号。我漏掉了一个逗号还是什么?

【问题讨论】:

  • 您在"$businessName" 之前缺少,

标签: firebase-realtime-database firebase-authentication firebase-security


【解决方案1】:

正如@Frank van Puffelen 所说,我只是在“$businessName”之前少了一个逗号。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-07-09
    • 2018-02-07
    • 1970-01-01
    • 2017-07-15
    • 2018-07-22
    • 1970-01-01
    • 2020-02-24
    • 1970-01-01
    相关资源
    最近更新 更多