首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Firestore PERMISSION_DENIED

Firestore PERMISSION_DENIED
EN

Stack Overflow用户
提问于 2022-01-12 17:24:13
回答 2查看 3.5K关注 0票数 3

我在macOs上有这个问题,当我编写我的颤振应用程序时,相同的基本代码在我的windows pc上工作,但在macOs中它不工作。正如您在我的日志中所看到的,应用程序是连接的,但我仍然无法在Firestore数据库上提出请求。

我改变了规则

代码语言:javascript
运行
复制
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if request.auth != null;
    }
  }
}

代码语言:javascript
运行
复制
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
  }
}

但我也犯了同样的错误。

代码语言:javascript
运行
复制
D/FirebaseAuth(11790): Notifying id token listeners about user ( tNGS8j375AYehEPDhZADPP80zLY2 ).
W/DynamiteModule(11790): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(11790): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(11790): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
W/Firestore(11790): (24.0.0) [Firestore]: Listen for Query(target=Query(usersProDEV where uuid == tNGS8j375AYehEPDhZADPP80zLY2 order by __name__);limitType=LIMIT_TO_FIRST) failed: Status{code=PERMISSION_DENIED, description=Missing or insufficient permissions., cause=null}
E/flutter (11790): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: [cloud_firestore/permission-denied] The caller does not have permission to execute the specified operation.

相同的代码在我的windows PC中工作。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-01-15 00:48:05

几次之后,我意识到问题不仅在MacOs下,而且在仿真器中。通过深入研究,我意识到我在这个项目上激活的是AppCheck,它不接受模拟器下的调试模式的所有请求。

票数 4
EN

Stack Overflow用户

发布于 2022-01-12 21:24:27

根据这个帖子,你的应用程序访问互联网有一个错误。请检查您的网络连接:

检查您是否在androidManifest文件中具有适当的互联网权限(由AbHishek荷兰建议)。如果您正在使用模拟器,请检查模拟器是否可以使用此post进行上网

第一版:

请您尝试使用此文档中的示例代码进行身份验证:

代码语言:javascript
运行
复制
  service cloud.firestore {
      match /databases/{database}/documents {
        match /messages/{document=**} {
          allow read, update, delete: if request.auth.uid == resource.data.uid;
          allow create: if request.auth.uid != null;
        }
      }
    }

此代码只能用于读写:

代码语言:javascript
运行
复制
   service cloud.firestore {
        match /databases/{database}/documents {
         match /{document=**} {
           allow read: if true;
           allow write: if false;
          }
       }
    }
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70685823

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档