【发布时间】:2025-11-22 21:30:01
【问题描述】:
我有以下结构:
+ properties: (collection)
- address
status
type
ownerId
renterId
+ offers (collection)
- id
amount
date
- id
amount
date
+ features (collection)
- id
name
- id
name
我想允许所有者(使用ownerId)、租用者(使用renterId)和管理员对properties 进行读取访问。
这样做似乎不起作用:
match /properties/{property} {
allow read, write: if get(/databases/$(database)/documents/properties/$(property)).data.renter == request.auth.uid
|| isOwnerSeller(get(/databases/$(database)/documents/properties/$(property)))
|| isAAdmin();
}
我错过了什么? 我也可以只定位优惠吗?
【问题讨论】:
-
请编辑问题以显示无法按照您期望的方式使用规则的查询。如果没有允许或拒绝的相关查询,规则就没有多大意义。还请显示整套规则。您现在展示的内容不包括可能产生影响的几个功能。由于我们看不到查询和完整的规则,因此我们无法说出您的规则是否符合您的预期。
标签: firebase google-cloud-platform google-cloud-firestore firebase-security