更新时间:2023-12-01 22:28:34
You should check the auth
variable.
要定义仅允许通过此电子邮件地址firebaseowner@gmail.com
对所有位置进行写访问的安全规则:
To define the security rules that allow write access to all the locations by this email address firebaseowner@gmail.com
only:
{
"rules": {
".read": true,
".write": "auth != null && auth.token.email == 'firebaseowner@gmail.com'"
}
}
要定义仅允许通过此电子邮件地址firebaseowner@gmail.com
仅访问位置/users
的安全规则,请执行以下操作:
To define the security rules that allow write access to only the location /users
by this email address firebaseowner@gmail.com
only:
{
"rules": {
".read": true,
"users": {
".write": "auth != null && auth.token.email == 'firebaseowner@gmail.com'"
}
}
}