dynamic modules loading

I’m trying to make a dynamic modules loading system. I would have a core module that extends CModule that I import in my main.php config file. This core module would load other modules following user’s roles. I’m trying to call a function in the core module that would load those modules but I don’t know how to access that function from my BaseController.

I don’t know if i’m doing things right for this system, if you have a better idea for dynamic modules loading, let me know.

Thanks for the advice

Not sure if this is much related, but maybe it can help you.

thanks; looks like I can make use of this but I hardly understand what it really does.