提问者:小点点

flutter-[Firebase]您的云Firestore数据库有不安全的规则


我不知道为什么我会收到这封邮件,我从来没有在我的flutter项目中使用过Firebase数据库,

单击超链接后,它将重定向到此代码

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
  }
}

共2个答案

匿名用户

在使用Cloud Firestore时,您必须设置数据库规则,以定义谁有权访问特定集合和文档。 在此了解更多有关它们的信息

匿名用户

如果您根本不打算在您的项目中使用Cloud Firestore数据库,我建议关闭所有读/写操作。 这也将停止不安全规则的电子邮件提醒。

只需将allow read,write:if true;更改为allow read,write:if false;

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if false;
    }
  }
}