So…I think I know how I want to do this but need some confirmations.
In order to make this application modular based on either the users permissions (or maybe something else), key functional groups will be housed in modules and will either work/not work be visible/invisible according to those user permissions. Since I can easily load the modules via the moduleservice and can data-drive this, I think it’s completely do-able. But I have always been of the philosophy that just because you can do a thing does not mean you should. I also have found that I am always better off letting frameworks do most of the thinking for me.
Option 1
Exclude ALL modules (except one perhaps)
In this design, ALL modules are excluded then, after configuration loads, I can check to see if a user is logged in and if so, manually load the modules that the user can see.
Option 2
Include ALL modules and disable as needed
In this design, ALL modules are included, loaded via the framework as they need to be, use settings in config() and after modules loads set environment variables and keys, etc. One key difference here is that modules settings that dictate how the user can interact may all initially need to be set to “fully working” then those values have to be reset before any rendering occurs.
Option 3
Include ALL modules and secure/disable functionality on the fly
In this design, everything loads and is enabled as the framework wants them to be and if the user tries to interact with something, the module has to determine the course of action.
For me, all have pros and cons. Truthfully, I want this to be dynamic so ideally I’d like to exclude everything by default and load what I want, when I want. I also want the order of the load to be dynamically driven which further makes the include options a bit less tenable, though not impossible to manage. I have a service-controller class that interact and collect module settings to determine visual interaction, etc. so its not absolutely necessary.
I think I can visualize how all these options might work and have been getting better and better at CB so I’m much more comfortable now than I was maybe six months ago…but has anyone tried some of these options, or others to achieve dynamic / secured module loading that could share some experience? Is there a “best” way to manage this?
Thanks,
Mike Craig