Assign user admin rights via mysql command line (database tables)

scottrace wrote on Tuesday, August 23, 2016:

Hello,
I’m having a hard time getting into my admin account on an installation of OpenEMR that we have taken over from a previous consultant. She didn’t leave us any admin logins.

Is there a field for admin access? I’d like to assign an existing user admin rights, and then reset passwords from the GUI.

Thanks!
Scott

scottrace wrote on Tuesday, August 23, 2016:

Looking at the gacl tables. Lots of good stuff in there, but cant seem to find exactly what I’m looking for.

bradymiller wrote on Wednesday, August 24, 2016:

Hi,

Try this(if there happen to be admin logins that you don’t have the password for):
http://www.open-emr.org/wiki/index.php/FAQ#What_do_I_do_if_I_am_locked_out_of_OpenEMR.3F

-brady
OpenEMR

1 Like

gowepp wrote on Wednesday, August 24, 2016:

Hi,

To give any users to admin rights,

SELECT * FROM gacl_aro; - Get the id for the required user to which you have to give the admin rights

then,

SELECT * FROM gacl_aro_groups - Get the id for the admin value

Update the group_id with aro_groups(id) from the gacl_aro_groups table for the aro_id(id) selected from the gacl_aro

Once you create new admin user after login, you can revert this back to the old group_id which you have updated. Or in UI you can navigate to Administration->ACL Edit the users memberships for specific user.

Hope this helps.

Thanks,
Wepp Team

scottrace wrote on Wednesday, August 24, 2016:

Awesome thanks! I’ll give the gacl a try first, that seems to be my best bet. I’ll post back the results.

scottrace wrote on Wednesday, August 24, 2016:

Is the group membership held in the order_value field in the gacl_aro table?

gowepp wrote on Wednesday, August 24, 2016:

No. id from gacl_aro for the specific user and id from gacl_aro_groups for the Admin group.

Update this on gacl_groups_aro_map , group_id from gacl_aro_groups and aro_id from gacl_aro.

Let us know, if this helps.

Thanks,
Wepp Team

scottrace wrote on Wednesday, August 24, 2016:

Hey that’s great, that worked perfect!!! Thanks so much.