BobbyWibowo / lolisafe

Blazing fast file uploader and awesome bunker written in node! 🚀
MIT License
317 stars 56 forks source link

Promote to superadmin #635

Closed perdedora closed 1 year ago

perdedora commented 1 year ago

Is there any possibility without changing in the database to promote a admin to a superadmin?

BobbyWibowo commented 1 year ago

You could edit https://github.com/BobbyWibowo/lolisafe/blob/safe.fiery.me/controllers/permissionController.js and add a new usergroup with higher permission number value than superadmin's, and assign yourself to it (though you will need to manually query the database to do so) But going forward said user will be able to promote anyone to superadmins via the dashboard

Be advised that "root" user is hard-coded to always have superadmin permission for compatibility reasons with non-fork installs (no longer the case since commit https://github.com/BobbyWibowo/lolisafe/commit/729883a4f5291c76b7e9429e2df00c9c83418fc9, as it's instead governed by some config values that only affect fresh installs, and can safely be turned off after the initial setup) But you can safely delete the user via manual database query, since the API endpoints will prevent any attempt to re-create "root" user

perdedora commented 1 year ago

Thanks for the quick response.