Hello there, I am using DHIS2 version 2.38. and I accidentally removed the authorities -ALL authority of superuser role. what should I do to bring back those authorities. @Gassim Please help
@blen are you currently able to log in with your superuser Account . Who else is the superuser other than you in the system
no-one is superuser just me . and yes I can login
@blen If you have direct access to the DHIS2 database (Postgres), you can try to re-add the lost authority manually.
- Login to your DHIS2 server console and launch PostgreSQL client:
sudo -u postgres -i psql
- In the PostgreSQL client console, connect to your DHIS2 database (we assume that its name is dhis):
- Find an internal database role ID (userroleid) for a Superuser:
SELECT userroleid FROM userrole WHERE code='Superuser';
This command should return a numeric value (typically, it is 2).
- Recreate the missing authority for a Superuser, using just obtained userroleid value (2):
INSERT INTO userroleauthorities (userroleid, authority) VALUES (2, 'ALL');
- Check that you have inserted the record correctly and you can find the ALL authority in the list:
SELECT authority FROM userroleauthorities WHERE userroleid=2;
- Check through the DHIS2 web UI that the permissions are back.