CodeIgniter Forums
Module based events to create configurations - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Module based events to create configurations (/showthread.php?tid=82606)



Module based events to create configurations - superior - 07-29-2022

Hello,

I've been working on a module based application because I manage different branches in a single solution. This way i'm able to enable/disable modules per user so it looks like something personal for my customers. A few modules require some user specific configurations that's being stored in my database (different table). This is handled through Myth Auth with the permissions table to make shure the user is allowed to use this module.

My question:
Is it possible to trigger an event when a certain permission is enabled to add configurations in my table without having to deal with it manually so the user can start right away?

Myth Auth: 1.2.1
CodeIgniter: 4.2.1
PHP Version: 8.0.14


RE: Module based events to create configurations - iRedds - 07-30-2022

The model supports afterInsert and afterUpdate events. Here you can check the compliance with the required permissions and do what you want.


RE: Module based events to create configurations - superior - 08-01-2022

Is that the proper solution to work with it or are there better ways?
Looking for a longterm solution because these configurations can grow by allot and I would like to use them only if required.