【发布时间】:2020-06-09 11:09:26
【问题描述】:
我尝试设置基本安全规则,并将从 request.auth 返回的 uid 作为文档 ID 存储在我的文档中,但是在设置规则时
match /users/{id}
allow read,write: if request.auth.uid == id
【问题讨论】:
标签: google-cloud-firestore firebase-security
我尝试设置基本安全规则,并将从 request.auth 返回的 uid 作为文档 ID 存储在我的文档中,但是在设置规则时
match /users/{id}
allow read,write: if request.auth.uid == id
【问题讨论】:
标签: google-cloud-firestore firebase-security
/users/{id} 这样的别名。总结一下,试试:
位置=/users/dummyid
uid=dummyid
【讨论】:
match /users/{userId} { allow read, update, delete: if request.auth.uid == get(/databases/$(database)/documents/users/$(request.auth.uid)).data.userId allow create: if request.auth.uid != null; }