RoleForm: Provide share restrictions for users and groups

refs #5600
This commit is contained in:
Johannes Meyer 2015-09-16 16:24:29 +02:00
parent 99502a77e0
commit 0cff2ca545

View File

@ -28,7 +28,7 @@ class RoleForm extends ConfigForm
* *
* @var array * @var array
*/ */
protected $providedRestrictions = array(); protected $providedRestrictions;
/** /**
* {@inheritdoc} * {@inheritdoc}
@ -70,9 +70,23 @@ class RoleForm extends ConfigForm
'config/modules' => 'config/modules' 'config/modules' => 'config/modules'
*/ */
); );
$helper = new Zend_Form_Element('bogus'); $helper = new Zend_Form_Element('bogus');
$this->providedRestrictions = array(
$helper->filterName('application/share/users') => array(
'name' => 'application/share/users',
'description' => $this->translate(
'Restrict which users this role can share items and information with'
)
),
$helper->filterName('application/share/groups') => array(
'name' => 'application/share/groups',
'description' => $this->translate(
'Restrict which groups this role can share items and information with'
)
)
);
$mm = Icinga::app()->getModuleManager(); $mm = Icinga::app()->getModuleManager();
foreach ($mm->listInstalledModules() as $moduleName) { foreach ($mm->listInstalledModules() as $moduleName) {
$modulePermission = $mm::MODULE_PERMISSION_NS . $moduleName; $modulePermission = $mm::MODULE_PERMISSION_NS . $moduleName;