小编tem*_*eva的帖子

路径中有空格的 Firestore 安全规则

我需要为名为“测试用例”的子集合创建一个 firestore 规则。由于 Firestore 规则不是用 javascript 编写的,因此我似乎无法在匹配后获得路径以接受空格而不会出错。

我试过引号,转义字符的反斜杠,并将整个路径放在引号中。我在 firestore 文档或堆栈溢出中没有找到任何相关内容。

如何在匹配后的路径中允许空格,在下面的示例中,在包含“测试用例”的路径中?

service cloud.firestore {

  match /databases/{database}/documents {

    match /companies/{company} {
      allow read: if getUserCompany() == company || userHasAnyRole(['Super', 'Manager']);
      allow write: if getUserCompany() == company || userHasAnyRole(['Super', 'Manager']); 

      match /Test Cases/{tests} {
        allow read, write: if isSignedIn();
      }
    }
Run Code Online (Sandbox Code Playgroud)

firebase firebase-security firebase-authentication google-cloud-firestore

1
推荐指数
1
解决办法
1128
查看次数