Jump to content

User Permissions Issues: Tracing Orphaned Entries in DB


Eutanasio

Recommended Posts

Hi!

I’ve been having issues with user permissions in the admin panel for quite some time. I suspect it might be due to leftover database entries from poorly designed modules that didn’t clean up properly when uninstalled.

I’m considering starting with these three SELECT queries to identify potential problems:

Find orphaned roles in ps_authorization_role:

SELECT ar.* FROM ps_authorization_role ar LEFT JOIN ps_module m ON m.id_module = ar.id_module WHERE m.id_module IS NULL;

Find orphaned permissions in ps_employee_access:

SELECT ea.* FROM ps_employee_access ea LEFT JOIN ps_module m ON m.id_module = ea.id_module WHERE m.id_module IS NULL;

(Optional) Check for leftovers in ps_module_access:

SELECT ma.* FROM ps_module_access ma LEFT JOIN ps_module m ON m.id_module = ma.id_module WHERE m.id_module IS NULL;

Would these be a good starting point to track down potential issues? Or do you recommend another approach?

Thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...