Extendy / SmartyURL

SmartyURL is a PHP-based web application for Smart URL management, Sharing, shortening, and analytics, featuring smart redirects.
https://docs.smartyurl.extendy.net/
MIT License
12 stars 2 forks source link

refactor: Store user groups definition in the database. #98

Closed mshannaq closed 11 months ago

mshannaq commented 11 months ago

If we want to let the administrators control the usergroups permissions and update it from the portal instead of Editing the config files that mean we should store the AuthGroups.php $groups and AuthGroups.php $matrix into database. while we will keep the permissions $permissions in file because there is no need to let the admin add or modify permissions itself.

We're shifting control of user groups and theirs permissions to administrators via the portal, that eliminating the need to modify configuration files. To facilitate this transition, we must store user group definitions and their permissions in the database.

Completed in the database migration file app/Database/Migrations/2023-11-16-171158_AddDefaultSettings1.php. (that need php spark migrate for updating to this version from old SmartyURL versions).

Next, we'll manage user groups using the CodeIgniter settings library. Grateful for CodeIgniter's efficient handling of settings.

CodeIgniter shield automatically uses setting to try to get the user groups and matrix.