📌  相关文章
📜  [未处理的承诺拒绝:FirebaseError:缺少或不足的权限.] - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:26.201000             🧑  作者: Mango

代码示例4
//"firestore missing or insufficient permissions" could be because of 
//insufficient read and/or write permissions

//Let's say that a user is not logged in but needs to read landmarks data,
//we should then create a rule to allow the read operation
service cloud.firestore {
  match /databases/{database}/documents {
    // Explicitly allow users to read the collection
    // even if they are not authenticated
    match /landmarks/{landmark} {
    allow read;
    }

    match /cities/{city} {
      allow read, write: if ;
    }
  }
}
//More info on structuring security rules:
//https://firebase.google.com/docs/firestore/security/rules-structure