Accessing Firestore from Firebase Realtime Database Security Rules

♀尐吖头ヾ 提交于 2021-01-29 06:28:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!