某些用户的 Firebase 存储视图
Firebase Storage View by certain users
我是 firebase 的新手,我开发了一个可以保存文档的应用程序。我想为可以查看 "Real-Time Data" 但不能查看 "Storage" 的团队成员分配一个角色,因为很少有文件是机密的。队友不应有权查看 firebase 中的存储文件。
我可以通过在 firebase 中添加规则来实现吗?如果是,如何?
如果我不能这样做,替代方案是什么?
在 Firebase 控制台中,您可以将这些广泛的角色分配给项目的协作者:
如您所见,Database 和 Storage 在这里属于同一角色,因此您不能为它们分配不同的权限。
幸运的是,您还可以在云控制台中定义 custom role,这样您就可以 精细控制协作者可以做什么。
您需要阅读有关 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 的文档,您需要其中之一:
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
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
我是 firebase 的新手,我开发了一个可以保存文档的应用程序。我想为可以查看 "Real-Time Data" 但不能查看 "Storage" 的团队成员分配一个角色,因为很少有文件是机密的。队友不应有权查看 firebase 中的存储文件。
我可以通过在 firebase 中添加规则来实现吗?如果是,如何?
如果我不能这样做,替代方案是什么?
在 Firebase 控制台中,您可以将这些广泛的角色分配给项目的协作者:
如您所见,Database 和 Storage 在这里属于同一角色,因此您不能为它们分配不同的权限。
幸运的是,您还可以在云控制台中定义 custom role,这样您就可以 精细控制协作者可以做什么。
您需要阅读有关 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 的文档,您需要其中之一:
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
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