mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
monitoring/security: Disable toggling object features if user lacks the permission monitoring/command/feature/object
This commit is contained in:
parent
bdc637ff67
commit
1681f746c1
@ -28,13 +28,15 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm
|
|||||||
*/
|
*/
|
||||||
public function createElements(array $formData = array())
|
public function createElements(array $formData = array())
|
||||||
{
|
{
|
||||||
|
$toggleDisabled = $this->hasPermission('monitoring/command/feature/instance') ? null : '';
|
||||||
$this->addElements(array(
|
$this->addElements(array(
|
||||||
array(
|
array(
|
||||||
'checkbox',
|
'checkbox',
|
||||||
ToggleObjectFeatureCommand::FEATURE_ACTIVE_CHECKS,
|
ToggleObjectFeatureCommand::FEATURE_ACTIVE_CHECKS,
|
||||||
array(
|
array(
|
||||||
'label' => $this->translate('Active Checks'),
|
'label' => $this->translate('Active Checks'),
|
||||||
'autosubmit' => true
|
'autosubmit' => true,
|
||||||
|
'disabled' => $toggleDisabled
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
@ -42,7 +44,8 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm
|
|||||||
ToggleObjectFeatureCommand::FEATURE_PASSIVE_CHECKS,
|
ToggleObjectFeatureCommand::FEATURE_PASSIVE_CHECKS,
|
||||||
array(
|
array(
|
||||||
'label' => $this->translate('Passive Checks'),
|
'label' => $this->translate('Passive Checks'),
|
||||||
'autosubmit' => true
|
'autosubmit' => true,
|
||||||
|
'disabled' => $toggleDisabled
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
@ -50,7 +53,8 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm
|
|||||||
ToggleObjectFeatureCommand::FEATURE_OBSESSING,
|
ToggleObjectFeatureCommand::FEATURE_OBSESSING,
|
||||||
array(
|
array(
|
||||||
'label' => $this->translate('Obsessing'),
|
'label' => $this->translate('Obsessing'),
|
||||||
'autosubmit' => true
|
'autosubmit' => true,
|
||||||
|
'disabled' => $toggleDisabled
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
@ -58,7 +62,8 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm
|
|||||||
ToggleObjectFeatureCommand::FEATURE_NOTIFICATIONS,
|
ToggleObjectFeatureCommand::FEATURE_NOTIFICATIONS,
|
||||||
array(
|
array(
|
||||||
'label' => $this->translate('Notifications'),
|
'label' => $this->translate('Notifications'),
|
||||||
'autosubmit' => true
|
'autosubmit' => true,
|
||||||
|
'disabled' => $toggleDisabled
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
@ -66,7 +71,8 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm
|
|||||||
ToggleObjectFeatureCommand::FEATURE_EVENT_HANDLER,
|
ToggleObjectFeatureCommand::FEATURE_EVENT_HANDLER,
|
||||||
array(
|
array(
|
||||||
'label' => $this->translate('Event Handler'),
|
'label' => $this->translate('Event Handler'),
|
||||||
'autosubmit' => true
|
'autosubmit' => true,
|
||||||
|
'disabled' => $toggleDisabled
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
@ -74,7 +80,8 @@ class ToggleObjectFeaturesCommandForm extends ObjectsCommandForm
|
|||||||
ToggleObjectFeatureCommand::FEATURE_FLAP_DETECTION,
|
ToggleObjectFeatureCommand::FEATURE_FLAP_DETECTION,
|
||||||
array(
|
array(
|
||||||
'label' => $this->translate('Flap Detection'),
|
'label' => $this->translate('Flap Detection'),
|
||||||
'autosubmit' => true
|
'autosubmit' => true,
|
||||||
|
'disabled' => $toggleDisabled
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user