【问题标题】:Grafana:change the role of an existing userGrafana:更改现有用户的角色
【发布时间】:2021-05-09 07:48:24
【问题描述】:

我使用curl 命令创建了几个 Grafana 用户。这是我使用的命令。

curl -XPOST -H "Content-Type: application/json" -d '{
  "name":"user1@graf.com",
  "email":"user1@graf.com",
  "password":"userpassword",
  "role": "Admin"
}' http://admin:admin@grafana01.default.svc.cluster.local:3000/api/admin/users

现在我想将角色从Admin 更改为Viewer。我怎样才能做到这一点?。还有其他方法可以尝试吗?任何帮助表示赞赏?

【问题讨论】:

    标签: prometheus grafana grafana-variable grafana-api


    【解决方案1】:

    例如,要将角色更新为查看器,您可以这样做:

    curl -XPATCH -H "Content-Type: application/json" -d '{
      "role":"Viewer"
    }' http://admin:admin@grafana01.default.svc.cluster.local:3000/api/orgs/:orgId/users/:userId
    

    一定要使用正确的orgId和userId

    看看 https://github.com/grafana/grafana/issues/11945

    编辑:我编辑了我之前的(和错误的)答案。

    【讨论】:

      猜你喜欢
      • 2021-08-15
      • 1970-01-01
      • 1970-01-01
      • 2012-02-29
      • 2017-08-10
      • 2012-08-23
      • 1970-01-01
      • 2013-09-17
      • 2021-07-11
      相关资源
      最近更新 更多