Skip to content

Instantly share code, notes, and snippets.

@jtcressy
Last active February 7, 2017 06:10
Show Gist options
  • Save jtcressy/66c356dabbf16b61f7722fd17459ab19 to your computer and use it in GitHub Desktop.
Save jtcressy/66c356dabbf16b61f7722fd17459ab19 to your computer and use it in GitHub Desktop.
Very hacky workaround to make more admin users in codenvy onprem

##Run this against your postgresql instance running codenvy 5.1.2 or 5.2.2

  • docker exec -it codenvy_postgresql_1 bash then psql --user pgcodenvy --db dbcodenvy
  • Replace 'user' with the LOGIN for the user you want to make an admin
  • Replace 'id' with some number that does NOT already exist in your systempermissions table
  • hint: run SELECT * FROM systempermissions; to see current entries and the id's
  • Run the commands in the above file (after editing the variables) and enjoy admin perms on this user

This works for any type of user on the system, whether it's backed by database or an OAuth application (like github)

INSERT INTO systempermissions(userid,id) VALUES((SELECT id FROM account WHERE name = 'user'),'id');
INSERT INTO systempermissions_actions(systempermissions_id,actions) VALUES('id','manageSystem');
INSERT INTO systempermissions_actions(systempermissions_id,actions) VALUES('id','setPermissions');
INSERT INTO systempermissions_actions(systempermissions_id,actions) VALUES('id','manageUsers');
INSERT INTO systempermissions_actions(systempermissions_id,actions) VALUES('id','manageOrganizations');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment