[英]Firebase - How to set security rules so that only logged in users can read and write?
Firebase - How to set security rules so that only logged in users can read and write for a specific table? Firebase - 如何设置安全规则以便只有登录用户才能读写特定表?
For the logins I'm using firebase built in authentication.对于登录,我使用 firebase 内置身份验证。
You can check on the auth
variable 您可以检查auth
变量
{
"rules": {
"posts": {
"$post_id": {
".write": "auth != null"
}
}
}
}
Check out the Firebase Security Guide for more information. 请查看《 Firebase安全指南》以了解更多信息。
Also, you may want to check out the Bolt compiler. 另外,您可能想签出Bolt编译器。
by changing the rules as follows通过改变规则如下
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth != null;
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.