Restoring Admin Permissions

I have an installation of Sonarqube 7.3 and while managing user permissions, I accidentally clicked the checkbox to remove admin permissions (I meant to do it for someone else). Unfortunately, once this checkbox is clicked, there is no warning window or confirmation. Now I am unable to access ‘Administration’ entirely, it has disappeared completely. There are no others users with these permissions. I am essentially locked out, how can I recover permissions? I am using postgres as my db, can it be restored there?

Hi Kevin,

I believe these are the droids you’ve been looking for. Use the insert query documented there, of course substituting your username for ‘mylogin’.

Hope this helps!


In case you run into a constraint error running the query from the docs I linked, try this variant:

INSERT INTO user_roles(user_id, role, organization_uuid) 
VALUES ((select id from users where login='mylogin'), 
(select uuid from organizations where kee='default-organization'));