Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
FirebaseError:缺少或权限不足。只读_Firebase_Vue.js_Google Cloud Firestore_Flamelink Cms - Fatal编程技术网

FirebaseError:缺少或权限不足。只读

FirebaseError:缺少或权限不足。只读,firebase,vue.js,google-cloud-firestore,flamelink-cms,Firebase,Vue.js,Google Cloud Firestore,Flamelink Cms,我的开发站点运行良好,带有“允许读取:如果为真”。在生产中,我做了如下更改,允许对公共集合进行读取访问。我能够下载数据,并且我的前端渲染正确,但我在控制台中遇到权限错误 我使用flamelink作为cms,在某些字段中放置引用。我是否还需要对所有引用集合的读取权限 service cloud.firestore { match /databases/{database}/documents { match /fl_content/{document} { allow re

我的开发站点运行良好,带有“允许读取:如果为真”。在生产中,我做了如下更改,允许对公共集合进行读取访问。我能够下载数据,并且我的前端渲染正确,但我在控制台中遇到权限错误

我使用flamelink作为cms,在某些字段中放置引用。我是否还需要对所有引用集合的读取权限

service cloud.firestore {
  match /databases/{database}/documents {
    match /fl_content/{document} {
      allow read: if true
    }
    match /fl_files/{document} {
      allow read: if true
    }
    match /fl_navigation/{document} {
      allow read: if true
    }
    match /{document=**} {
      allow read, write: if request.auth.uid != null;
    }
  }
}
我正在使用此Vue方法接收数据。数据已被接收,我可以访问它

firestore: {
        pageContent: firestore
            .collection("fl_content")
            .where("_fl_meta_.schema", "==", "aboutPage")
            .limit(1),
    },
但是控制台显示错误

快照侦听器中出现未捕获错误:FirebaseError:缺少权限或权限不足


有什么帮助吗?

好的,那么。。。首先,我认为您不需要匿名访问数据库,即:if true。最后一句话:

  match /{document=**} {
        allow read, write: if request.auth.uid != null;
    }

正在为经过身份验证的用户授予对所有数据库的读取权限,这应该足够了。规则是自上而下匹配的,因此您看到的错误可能是因为您对相关集合进行了读取,但其中的引用指向另一个集合,此时该集合没有权限,但是,当您到达最后一条语句时,这些权限已被授予,因此您可以获得数据。

该网站是一个公共网站(匿名访问),通过firestore生成内容。这允许用户在连接的CMS中编辑网站内容。如果我没有匿名读取权限,网站将不会呈现。已验证的读/写规则用于CMS。说我会检查参考资料,虽然我是通过匿名访问该网站的,它呈现良好。好的,尝试将所有收藏添加到阅读列表中,我的意思是,那些需要匿名访问的收藏。