Firebase firestore安全性的通配符变量未按预期工作
这是基本的安全规则Firebase firestore安全性的通配符变量未按预期工作,firebase,google-cloud-firestore,firebase-security,Firebase,Google Cloud Firestore,Firebase Security,这是基本的安全规则 rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /patients/{patientId} { allow read: if request.auth.uid == patientId; } } } 我传递的auth.uid与patients集合中已经存在的auth.uid相同。但是firestore
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /patients/{patientId} {
allow read: if request.auth.uid == patientId;
}
}
}
我传递的auth.uid与patients集合中已经存在的auth.uid相同。但是firestore安全仿真器拒绝此规则,因为request.auth.uid与patientId不匹配。Patient id通配符变量返回的“{patientId}”与我在auth.uid中传递的文档id字符串不匹配请编辑问题以显示发出请求的应用程序代码。没有这些,wek就看不出你是否做错了什么。确保显示准确的值,以便我们准确地知道此处使用的值。