【发布时间】:2019-01-23 15:58:04
【问题描述】:
我想只授予对我的 firestore 数据库集合中的一个字段的写入/更新访问权限,而无需请求身份验证服务。我的 Firestore 规则是:
service cloud.firestore {
match /databases/{database}/documents {
match /businesses/{businessId} {
allow read;
allow write: if request.auth.uid != null;
}
}
}
businesses 我的数据库结构是:
addedBy: string;
address: string;
category: string;
claim: boolean;
city: string;
email: string;
id: string;
likes: number;
location: {
_lat: number,
_long: number
};
name: string;
ocHours: [{
day: string,
from: string,
status: string,
to: string
}];
phone: number;
sponsored: boolean;
state: string;
status: string;
verificationCode: string;
我只想更新 claim 字段而不更新 request.auth.uid != null。
有什么建议吗?
【问题讨论】:
标签: firebase google-cloud-firestore firebase-security