IAM 角色和权限

您可通过向用户授予 Identity and Access Management (IAM) 角色来授予对 Filestore 操作的访问权限。

IAM 权限只能控制对 Filestore 操作(例如创建 Filestore 实例)的访问权限。如需控制对文件共享操作(例如读取或执行)的访问权限,请使用 POSIX 文件权限。

使用 Filestore 角色

如需向用户授予 Filestore 权限,请使用 Filestore Editor (roles/file.editor) 和 Filestore Viewer (roles/file.viewer) 角色。如果需要,还可以使用基本角色来实现此目的。

使用下表查看与 Filestore 角色关联的 Filestore 权限。

权限 操作 Filestore Editor Filestore Viewer
file.locations.get 获取该服务支持的位置的相关信息。 ✓ ✓
file.locations.list 列出该服务的支持位置的相关信息。 ✓ ✓
file.instances.create 创建 Filestore 实例。 ✓
file.instances.update 更新 Filestore 实例。 ✓
file.instances.delete 删除 Filestore 实例。 ✓
file.instances.get 获取有关特定 Filestore 实例的详细信息。 ✓ ✓
file.instances.list 列出项目中的 Filestore 实例。 ✓ ✓
file.operations.get 获取 Filestore 实例操作的状态。 ✓ ✓
file.operations.list 列出 Filestore 实例操作。 ✓ ✓
file.operations.cancel 取消 Filestore 实例操作。 ✓
file.operations.delete 删除 Filestore 实例操作。 ✓
file.backups.create 创建 Filestore 备份。 ✓
file.backups.update 更新 Filestore 备份。 ✓
file.backups.delete 删除 Filestore 备份。 ✓
file.backups.get 获取有关特定 Filestore 备份的详细信息。 ✓ ✓
file.backups.list 列出项目中的 Filestore 备份。 ✓ ✓
file.snapshots.create 创建 Filestore 快照。 ✓
file.snapshots.update 更新 Filestore 快照。 ✓
file.snapshots.delete 删除 Filestore 快照。 ✓
file.snapshots.get 获取有关特定 Filestore 快照的详细信息。 ✓ ✓
file.snapshots.list 列出项目中的 Filestore 快照。 ✓ ✓

使用基本角色

Filestore 权限还与所有者、编辑者和查看者的 IAM 基本角色相关联。如需向用户授予 Filestore 权限,除了 Filestore 角色之外,您还可以使用这些角色。

请使用下表查看与基本角色关联的 Filestore 权限。

权限 操作 Project Owner Project Editor Project Viewer
file.locations.get 获取该服务支持的位置的相关信息。 ✓ ✓ ✓
file.locations.list 列出该服务的支持位置的相关信息。 ✓ ✓ ✓
file.instances.create 创建 Filestore 实例。 ✓ ✓
file.instances.update 更新 Filestore 实例。 ✓ ✓
file.instances.delete 删除 Filestore 实例。 ✓ ✓
file.instances.get 获取有关特定 Filestore 实例的详细信息。 ✓ ✓ ✓
file.instances.list 列出项目中的 Filestore 实例。 ✓ ✓ ✓
file.operations.get 获取 Filestore 实例操作的状态。 ✓ ✓ ✓
file.operations.list 列出 Filestore 实例操作。 ✓ ✓ ✓
file.operations.cancel 取消 Filestore 实例操作。 ✓ ✓
file.operations.delete 删除 Filestore 实例操作。 ✓ ✓
file.backups.create 创建 Filestore 备份。 ✓ ✓
file.backups.update 更新 Filestore 备份。 ✓ ✓
file.backups.delete 删除 Filestore 备份。 ✓ ✓
file.backups.get 获取有关特定 Filestore 备份的详细信息。 ✓ ✓ ✓
file.backups.list 列出项目中的 Filestore 备份。 ✓ ✓ ✓
file.snapshots.create 创建 Filestore 快照。 ✓ ✓
file.snapshots.update 更新 Filestore 快照。 ✓ ✓
file.snapshots.delete 删除 Filestore 快照。 ✓ ✓
file.snapshots.get 获取有关特定 Filestore 快照的详细信息。 ✓ ✓ ✓
file.snapshots.list 列出项目中的 Filestore 快照。 ✓ ✓ ✓

自定义角色

如果预定义的 IAM 角色不符合您的需求,您可以使用通过 IAM 的自定义角色指定的权限来定义一个自定义角色。为 Filestore 创建自定义角色时,请确保同时包含 resourcemanager.projects.get 和 resourcemanager.projects.list,以便该角色具有查询项目资源的权限。

如需访问其他 Google Cloud 服务,可能还需要其他角色。例如,如果您想查看或监控与 Filestore 实例性能相关的指标,则需要具有以下角色的访问权限:

  • Monitoring Viewer
  • Monitoring Editor

如需了解如何授予对这些角色和其他角色的访问权限,请参阅授予对 Cloud Monitoring 的访问权限。

后续步骤