在 Firestore 文档上查找数据的 Firebase 存储规则? [英] Firebase Storage rules to lookup data on Firestore document?

查看:20
本文介绍了在 Firestore 文档上查找数据的 Firebase 存储规则?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以有一个类似于 Firestore 的 get() 函数的 Firebase 存储规则?

Is it possible to have a Firebase Storage rule that is similar to the get() function of Firestore?

基本上我想检查 Firestore 中的用户文档以允许写入存储.

Basically I would like to check the user document in Firestore to allow writes in Storage.

我想处理声明是最好的解决方案,但我不确定我是否可以使用它.

I guess working with claims would be the best solution, but I'm not sure I can use that.

我想要这样的东西:

allow create: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.canDoSomeStuff == true;

推荐答案

目前无法将任何 Firebase 产品的安全规则扩展到他们自己的产品之外.请随时为此提交功能请求.

It's currently not possible for security rules for any Firebase product to reach outside of their own product. Feel free to file a feature request for that.

这篇关于在 Firestore 文档上查找数据的 Firebase 存储规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆