Firebase - How to set security rules so that only logged in users can read and write for a specific table?
For the logins I'm using firebase built in authentication.
You can check on the auth
variable
{
"rules": {
"posts": {
"$post_id": {
".write": "auth != null"
}
}
}
}
by changing the rules as follows
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth != null;
}
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.