您可以為使用者授予 Identity and Access Management (IAM) 角色,讓使用者可存取 Filestore 作業。
身分與存取權管理權限只會控制對 Filestore 作業 (例如建立 Filestore 執行個體) 的存取權。如要控管對檔案共用區作業的存取權,例如讀取或執行,請使用 POSIX 檔案權限。
使用 Filestore 角色
如要授予使用者 Filestore 權限,請使用 Filestore 編輯者 (roles/file.editor
) 和 Filestore 檢視者 (roles/file.viewer
) 角色。如有需要,也可以基於此目的使用基本角色。
請參閱下表,瞭解與 Filestore 角色相關聯的 Filestore 權限。
權限 | 動作 | Filestore 編輯器 | Filestore 檢視器 |
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 權限。
權限 | 動作 | 專案擁有者 | 專案編輯器 | 專案檢視器 |
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 檢視者
- Monitoring 編輯者
如要瞭解如何授予這些角色和其他角色存取權,請參閱「授予 Cloud Monitoring 存取權」。
後續步驟
請試試 Filestore 的其中一個快速入門導覽課程: