问题
I'm actively using both of Firebase Realtime Database and Firestore. There is a case in which I need to check a document on Firestore to allow user to write on Firebase Realtime Database.
Basically, I need to access user's document in the users
collection on Firestore to allow user to create a post under the posts
node on Firebase Realtime Database.
Is something like this possible, by any chance?
"rules": {
"posts": {
".write": "get(/databases/$(database)/documents/users/$(auth.uid)).data.isVerified == true",
}
}
回答1:
No, it is not possible to cross products between in security rules.
The best you can do is mirror data between the two products where needed for rules.
来源:https://stackoverflow.com/questions/62630592/accessing-firestore-from-firebase-realtime-database-security-rules