【发布时间】:2018-11-26 11:47:25
【问题描述】:
我有以下 Firestore 规则,只允许用户访问他们的记录。它工作正常...
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read, update, delete: if request.auth.uid == userId;
allow create: if request.auth.uid != null;
}
}
}
现在在 users 集合下,每个文档都包含一个字段/键名称“isAuthenticated”,使用服务帐户权限从服务器端后端设置为 true。
如何设置规则以确保即使经过身份验证的用户也无法更新该特定密钥?
【问题讨论】:
-
为什么要在您的数据库中为每个用户跟踪
isAuthenticated?
标签: firebase google-cloud-firestore firebase-security