两天前Firestore停止工作,因为我需要更新安全规则,现在我这样做了,更改很好,我可以再次使用Firebase,但我的函数不再工作。
这是导致异常的代码行:
var ref = await FirebaseFirestore.instance
.collection("uids")
.doc("${uid[0] + uid[1]}")
.collection(uid)
.doc(uid)
.get();Firestore规则:
service cloud.firestore {
match /uids/{twoLetters}/{UserUid}/{anyDoc=**} {
allow read, write : if true;
}
}错误是:
PlatformException (PlatformException(permission-denied, The caller does not have permission
to execute the specified operation., {code: permission-denied,
message: The caller does not have permission to execute the specified operation.,
nativeErrorMessage: Missing or insufficient permissions., nativeErrorCode: 7}, null))由于规则不一致( allow read, write : if true ),我不明白为什么用户没有权限...
发布于 2021-05-31 18:32:16
这可能是因为您可能需要添加时间。例如,您可以这样做:
allow read, write: if request.time < timestamp.date(2021, 6, 1);https://stackoverflow.com/questions/67137333
复制相似问题