Welcome Guest, Not a member yet? Register   Sign In
CI4 Shield, Users, Groups, Permissions managment
#5

(03-13-2025, 09:23 AM)InsiteFX Wrote: Settings

In place of the CodeIgniter config() helper, Shield uses the official Settings library.
This provides a way to save any Config class values to the database if you want to modify them,
but falls back on the standard Config class if nothing is found in the database.

Ok i managed to install Settings library from here https://github.com/codeigniter4/settings...me-ov-file and managed to add setting to database using service. Values are saved in database like array same as in config AuthGroups. 

PHP Code:
service('settings')->set('AuthGroups.permissions'$permissions);

service('settings')->set('AuthGroups.groups'$groups); 

To get values or update value i know i can use database query builder or update through service. Now my question is do i check for permissions and groups like i did before
PHP Code:
if (auth()->user()->inGroup('admin''superadmin')) 
, or do i need to get setting from database, and do i need to make some extra configuration in order to read settings from database, like modify some files or delete permission and groups array values from AuthGroups file ? 


This is and image from database table settings 

[Image: Screenshot-1.jpg]
Reply


Messages In This Thread
RE: CI4 Shield, Users, Groups, Permissions managment - by brianjamestorr - 03-13-2025, 04:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB