某些用户的Firebase存储视图 [英] Firebase Storage View by certain users
问题描述
我是Firebase的新手,我开发了可以保存文档的应用程序.我想给可以查看实时数据"但不能查看存储"的团队成员分配角色,因为很少有文件是机密的.队友无权查看firebase中的存储文件.
I am new to firebase and I have developed an app which can save documents. I want to assign a role to my team member who can view "Real-Time Data" but not the "Storage" as few files are confidential. The team mate should not have access to view storage files in firebase.
我可以在firebase中添加规则来做到这一点吗?如果是,怎么办?
Can I do this by adding rules in firebase? If yes, how?
如果我不能这样做,那是什么?
If I cannot do this, what is the alternate?
推荐答案
在Firebase控制台中,您可以将这些广泛的角色分配给项目中的协作者:
Within the Firebase console you can assign these broad roles to the collaborators on a project:
如您所见,数据库和存储在这里扮演着相同的角色,因此您不能为其分配不同的权限.
As you can see, Database and Storage are in the same role here, so you can't assign different permissions for them.
幸运的是,您还可以在云中定义自定义角色控制台,可让您对协作者的功能进行精细控制.
Luckily you can also define a custom role in the Cloud console, which allows you fine grained control over what a collaborator can do.
您需要阅读授予,更改和修改文档撤消Cloud文档中的访问权限,然后构建一个具有必要的访问权限,您将需要以下之一:
You'll want to read the documentation on granting, changing and revoking access in the Cloud documentation, and then build a role that has the necessary Firebase product-level predefined roles. Since you want the collaborator to only have access to Realtime Database, you'll need one of these:
角色:Firebase实时数据库管理员
roles/firebasedatabase.admin
Role: Firebase Realtime Database Admin
roles/firebasedatabase.admin
说明:对以下内容的完全读/写访问权限 实时数据库资源
Description: Full read/write access to Realtime Database resources
实时数据库管理员权限:
Realtime Database Admin permissions:
-
firebasedatabase.instances.create
-
firebasedatabase.instances.get
-
firebasedatabase.instances.list
-
firebasedatabase.instances.update
firebasedatabase.instances.create
firebasedatabase.instances.get
firebasedatabase.instances.list
firebasedatabase.instances.update
角色:Firebase实时数据库查看器
roles/firebasedatabase.viewer
Role: Firebase Realtime Database Viewer
roles/firebasedatabase.viewer
说明:对实时数据库资源的只读访问权限
Description: Read-only access to Realtime Database resources
实时数据库查看器权限:
Realtime Database Viewer permissions:
-
firebasedatabase.instances.get
-
firebasedatabase.instances.list
firebasedatabase.instances.get
firebasedatabase.instances.list
这篇关于某些用户的Firebase存储视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!