授予访问“网络”选项卡的权限

ENTERPRISE

授予访问“网络”选项卡的权限

您可以授予用户访问网络选项卡的权限。新用户默认没有权限。

提示: 此过程可授予访问网络选项卡的全部用户权限。如果您希望配置更加细分的用户访问权限,请参阅 文档

使用 GUI 授予访问权限

先决条件:

  • 不具有 dcos:superuser 权限 的 DC/OS 用户账户。
  1. 以具有 superuser 权限的用户身份登录 DC/OS GUI。

    登录

    图 1. DC/OS Web 界面登录

  2. 选择组织,然后选择用户

  3. 选择要授予权限的用户名或组名。

    添加 cory 权限

    图 2. 选择要授予权限的用户或组

  1. 权限选项卡上,单击添加权限

  2. 单击插入权限字符串以切换对话框。

    添加权限

    图 3. 插入权限字符串

  3. 权限字符串字段中复制并粘贴权限。根据您的 安全模式 选择权限字符串,单击添加权限,然后单击关闭

宽容

  1. dcos:adminrouter:ops:networking full
  2. dcos:adminrouter:ops:mesos full

严格

  1. dcos:adminrouter:ops:networking full
  2. dcos:adminrouter:ops:mesos full

使用 API 授予访问权限

先决条件:

提示:

  • 服务资源通常包括 / 必须在 curl 请求中以 %252F 替换的字符,如下例所示。
  • 使用 API 管理权限时,您必须在授予之前先创建权限。如果权限已存在,API 将返回提示信息,您可以继续分配权限。

宽容

  1. 创建权限。

    1. curl -X PUT --cacert dcos-ca.crt \
    2. -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    3. -H 'Content-Type: application/json' \
    4. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:ops:networking \
    5. -d '{"description":"Grants access to the contents of the Network tab"}'
    6. curl -X PUT --cacert dcos-ca.crt \
    7. -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    8. -H 'Content-Type: application/json' \
    9. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:ops:mesos \
    10. -d '{"description":"Grants access to the Mesos master API/UI and task details"}'
  2. 向用户 uid 授予以下特权。

    1. curl -X PUT --cacert dcos-ca.crt \
    2. -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    3. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:ops:networking/users/<uid>/full
    4. curl -X PUT --cacert dcos-ca.crt \
    5. -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    6. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:ops:mesos/users/<uid>/full

    提示: 要向组而不是向用户授予权限,应将 /users/ 替换为 /groups/

严格

  1. 创建权限。

    1. curl -X PUT --cacert dcos-ca.crt \
    2. -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    3. -H 'Content-Type: application/json' \
    4. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:ops:networking \
    5. -d '{"description":"Grants access to the contents of the Network tab"}'
    6. curl -X PUT --cacert dcos-ca.crt \
    7. -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    8. -H 'Content-Type: application/json' \
    9. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:ops:mesos \
    10. -d '{"description":"Grants access to the Mesos master API/UI and task details"}'
  2. 向用户 uid 授予以下特权。

    1. curl -X PUT --cacert dcos-ca.crt \
    2. -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    3. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:ops:networking/users/<uid>/full
    4. curl -X PUT --cacert dcos-ca.crt \
    5. -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    6. $(dcos config show core.dcos_url)/acs/api/v1/acls/dcos:adminrouter:ops:mesos/users/<uid>/full

    提示: 要向组而不是向用户授予权限,应将 /users/ 替换为 /groups/