管理对笔记本的访问权限

本页面介绍了如何授予和撤消对 Colab Enterprise 笔记本(IPYNB 文件)的访问权限。

准备工作

  1. 登录您的 Google Cloud 账号。如果您是 Google Cloud新手, 请创建一个账号来评估我们的产品在 实际场景中的表现。新客户还可获享 $300 赠金,用于 运行、测试和部署工作负载。
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Vertex AI, Dataform, and Compute Engine APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the APIs

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. Enable the Vertex AI, Dataform, and Compute Engine APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the APIs

所需的角色

如需获得管理对 Colab Enterprise 笔记本的访问权限所需的权限,请让您的管理员为您授予项目的 Colab Enterprise Admin (roles/aiplatform.colabEnterpriseAdmin) IAM 角色。如需详细了解如何授予角色,请参阅管理对项目、文件夹和组织的访问权限

您也可以通过自定义角色或其他预定义角色来获取所需的权限。

授予对笔记本的访问权限

本部分介绍了如何向正文授予对 Colab Enterprise 笔记本的访问权限。

如需向正文授予对 Colab Enterprise 笔记本的访问权限,请执行以下操作:

  1. 在 Google Cloud 控制台中,前往 Colab Enterprise 我的笔记本 页面。

    前往我的笔记本

  2. 区域 菜单中,选择包含笔记本的区域。

  3. 在要共享的笔记本旁边,点击 笔记本操作 菜单,然后选择 共享

  4. 共享权限窗口中,点击  添加 用户/群组

  5. 添加用户/群组 对话框的新的主账号 字段中,输入一个或多个主账号,并用英文逗号分隔。

  6. 角色 列表中,选择以下角色之一:

  7. 点击保存

Colab Enterprise 主账号是用户、群组或网域

您可以向用户、群组或网域授予访问权限。请参阅下表:

主账号 示例用户账号
单个用户 user@gmail.com
Google 群组 admins@googlegroups.com
Google Workspace 网域 example.com

关闭笔记本输出保存功能

如需禁止与有权访问笔记本文件的其他用户共享保存的笔记本输出,您可以关闭笔记本输出保存功能。

为所选笔记本关闭输出保存功能后,Colab Enterprise 会删除笔记本文件中保存的所有输出,且不会保存后续运行的输出。

不过,有权访问笔记本的用户仍然可以通过以下方式查看其输出:

  • 运行笔记本以查看其当前输出。此输出不会保存。

  • 在修订历史记录中查看笔记本的归档版本及其输出。

如需为所选笔记本关闭输出保存功能,请执行以下操作:

  1. 在 Google Cloud 控制台中,前往 Colab Enterprise 我的笔记本 页面。

    前往我的笔记本

  2. 区域 菜单中,选择包含笔记本的区域。

  3. 如需打开笔记本,请点击其名称。

  4. 依次点击  显示/隐藏标题 > 修改 > 笔记本设置

  5. 笔记本设置 窗口中,选择 保存此笔记本时忽略代码单元格输出项

  6. 点击保存

  7. 点击重新加载

撤消对笔记本的访问权限

移除项目级访问权限

如需移除主账号的项目级访问权限,请执行以下操作:

  1. 在 Google Cloud 控制台中,前往 IAM 页面。

    转到 IAM

  2. 选择一个项目、文件夹或组织。

  3. 找到包含要撤消其访问权限的主账号的行。然后,点击该行中的 修改主账号

  4. 点击要撤消的角色对应的删除 按钮,然后点击保存

从笔记本中移除资源级访问权限

如需从特定笔记本中移除主账号的资源级访问权限,请执行以下操作:

  1. 在 Google Cloud 控制台中,前往 Colab Enterprise 我的笔记本 页面。

    前往我的笔记本

  2. 区域 菜单中,选择包含笔记本的区域。

  3. 在笔记本旁边,点击 笔记本操作 菜单,然后选择 共享

  4. 共享权限窗口中,找到要撤消其访问权限的主账号 。

  5. 点击主账号旁边的删除 按钮,然后点击保存

使用 IAM 拒绝政策撤消所有访问权限

除了移除各个资源级角色之外,您还可以 使用 IAM 拒绝政策 撤消主账号在项目中所有资源的所有权限。如果您需要快速撤消对所有资源的访问权限,而无需单独遍历每个笔记本,此方法会非常有用。

后续步骤