First, thanks for reading.
I'd like to have Modules
that have a particular configuration key in their local configs (an array of strings to be simplistic), contribute these strings to the Application
when needed. I want to use it to define all available RBAC rules for this particular app, for very specific JSON calls that the app performs across its many modules (that have this key!).
Here's an envisioned config in a module.config.php
for a fictitious Marketing module:
'rule_list' => array(
'title' => 'Marketing',
'asset' => 'marketing',
'sections' => array(
'statistics' => array(
'title' => "Day-To-Day",
'parts' => array(
array(
'title' => 'Statistics',
'asset' => 'marketing-statistics',
'route' => 'marketing/index/dashboard',
'description' => 'Inside view into marketing activity statistics and measurements'
)
)
)
)
),
The Application
module would have a Controller
with a listPermissionsAction
that I was hopeful could quickly reference all of these configs, and use them to render a view
But what's the best strategy? I want to avoid having the modules push their configs out to the App onInit, because this would de-DRY my code. The config inclusion should suffice.
Thanks for your guidance as always.
To clarify...
Looking for lines I can efficiently use to generate an array from the set of all Modules in the app with that particular config key.