Grafana Server Admin permissions changed to user

  • What Grafana version and what operating system are you using?
    Grafana V8.0.0
    Windows 10

  • What are you trying to achieve?
    I’m trying to change my Server Admin user to have full access privileges.

  • How are you trying to achieve it?
    Ideally by modifying the config, or sqlite3 DB entry for the admin permissions.

  • What happened?
    My Grafana Server Admin account had it’s permissions changed to user (view only). It no longer has the “shield” icon, nor can it do any admin functions.

  • What did you expect to happen?
    I expected the admin user to have full access privileges.

1 Like

welcome to the grafana community forums :grafana: @jmadden

I am not sure how to update those admin permissions via db query, but as a alternative method, you can try to update the user’s permissions via this api

This is a user I created and who did not have admin role

I noted the id of this user (the id is displayed in the browser’s URL). In my case the id was
2
image

Finally I called the endpoint, including the id 2

http:///community.grafana.com/api/admin/users/2/permissions

request body:


{"isGrafanaAdmin": true}

result:

{
    "message": "User permissions updated"
}

Went back to configuration > users > edit user ‘random 1’
The admin role was added.

note: you need to pass your username and password (admin user) in your request. It might not work for you since it is also required that the user you authenticate with has the users.permissions:write role. But, still, you can give it a go.

It’s a good idea, but yea, the problem is currently there is no user with write/admin permissions, so passing the admin user to the api can’t make the change since it doesn’t have write permissions.
Thanks for the suggestion though!

The Authentication team has shared this SQLite query that you can run on your local install of Grafana.

Here is the DB command (where data/grafana.db has to be replaced by your db path and the id has to be set according their admin user id)

sqlite3 data/grafana.db "UPDATE user SET is_admin = true WHERE id = 1" ".exit"

Good luck :crossed_fingers: !

So, the good news, the SQLite query/information was enough to get me moving on updating the user entry for the DB.

The bad news is that changed nothing for my install. I can confirm I have only one instance of Grafana (one DB) installed. So it’s not a permissions issue, but I still have no admin controls for changing user permissions or adding new dashboards, despite having only 1 user as the admin user with admin permissions.

Thanks for the help so far. Unfortunately I am still stumped here.