授予访问“组件”屏幕的权限

授予访问“组件”屏幕的权限

您可以授予用户访问 组件屏幕 的权限。新用户默认没有权限。

前提条件:

  • 不具有 的 DC/OS 用户账户。
  1. 选择组织,然后选择用户

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

  3. 权限屏幕上,单击添加权限

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

    添加权限

    图 3. 添加权限

宽容

  1. dcos:adminrouter:ops:historyservice full
  2. dcos:adminrouter:ops:system-health full

使用 API 授予访问权限

前提条件:

  • 必须 安装 DC/OS CLI 并以超级用户登户身份登录。
  • 必须 才能在本部分发出 curl 命令。
  • 服务资源通常包括 / 必须在 curl 请求中以 替换的字符,如下例所示。
  • 使用 API 管理权限时,您必须在授予之前先创建权限。如果权限已存在,API 将返回提示信息,您可以继续分配权限。
  1. 向用户 uid 授予以下特权。

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

    注意:要向组而不是向用户授予权限,应将 /users/"uid" 替换为。

严格

  1. 创建权限。

  2. 向用户 uid 授予以下特权。

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