Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
enh(acl) add poller access acl config (#11235)
Browse files Browse the repository at this point in the history
* enh(acl) add poller access acl config

* add help tip and translation

* fix update, adapt poller list page buttons

* fix translate

* apply suggestion

* Apply suggestions from code review

Co-authored-by: smau <102975713+smau-centreon@users.noreply.github.com>

* Update lang/fr_FR.UTF-8/LC_MESSAGES/help.po

Co-authored-by: Kevin Duret <kduret@centreon.com>

* Update lang/fr_FR.UTF-8/LC_MESSAGES/help.po

Co-authored-by: Kevin Duret <kduret@centreon.com>

* Update lang/fr_FR.UTF-8/LC_MESSAGES/help.po

Co-authored-by: Kevin Duret <kduret@centreon.com>

Co-authored-by: smau <102975713+smau-centreon@users.noreply.github.com>
Co-authored-by: Kevin Duret <kduret@centreon.com>
  • Loading branch information
3 people authored and emabassi-ext committed Jul 26, 2022
1 parent 2c03079 commit 1afb472
Show file tree
Hide file tree
Showing 10 changed files with 149 additions and 34 deletions.
23 changes: 22 additions & 1 deletion lang/es_ES.UTF-8/LC_MESSAGES/help.po
Original file line number Diff line number Diff line change
Expand Up @@ -4304,4 +4304,25 @@ msgstr "Ejecuta el comando definido en la configuración del recopilador (Config
#~ msgstr ""

#~ msgid "Additional Remote Server to which this server will be attached"
#~ msgstr ""
#~ msgstr ""

# msgid "Create and edit pollers"
# msgstr ""

# msgid "Delete pollers"
# msgstr ""

# msgid "Deploy configuration"
# msgstr ""

# msgid "Poller Configuration Actions / Poller Management"
# msgstr ""

# msgid "Allows user to perform “Add”, “Add (advanced)” and “Duplicate” actions on pollers."
# msgstr ""

# msgid "Allows user to delete pollers."
# msgstr ""

# msgid "Allows user to deploy configuration."
# msgstr ""
21 changes: 21 additions & 0 deletions lang/fr_FR.UTF-8/LC_MESSAGES/help.po
Original file line number Diff line number Diff line change
Expand Up @@ -7219,3 +7219,24 @@ msgid "Mode used to retrieve information displayed in Resource Status page."
"The optimized mode will only be available and functional when using the BBDO 3.0.0 protocol for the collect engine."
msgstr "Mode utilisé pour récupérer les données affichées dans la page Resource Status."
"Le mode optimisé pourra être utilisé et fonctionnel que si le moteur de supervision utilise le protocole BBDO 3.0.0"

msgid "Poller Configuration Actions / Poller Management"
msgstr "Actions de configuration du collecteur / Gestion du collecteur"

msgid "Create and edit pollers"
msgstr "Créer et modifier des collecteurs"

msgid "Delete pollers"
msgstr "Supprimer des collecteurs"

msgid "Deploy configuration"
msgstr "Déployer la configuration"

msgid "Allows user to perform “Add”, “Add (advanced)” and “Duplicate” actions on pollers."
msgstr "Permet à l'utilisateur de créer des collecteurs (boutons Ajouter, Ajouter (avancé) et Dupliquer)."

msgid "Allows user to delete pollers."
msgstr "Permet à l'utilisateur de supprimer des collecteurs."

msgid "Allows user to deploy configuration."
msgstr "Permet à l'utilisateur de déployer la configuration."
22 changes: 22 additions & 0 deletions lang/pt_BR.UTF-8/LC_MESSAGES/help.po
Original file line number Diff line number Diff line change
Expand Up @@ -6655,3 +6655,25 @@ msgstr ""

#~ msgid "Additional Remote Server to which this server will be attached"
#~ msgstr ""


# msgid "Poller Configuration Actions / Poller Management"
# msgstr ""

# msgid "Create and edit pollers"
# msgstr ""

# msgid "Delete pollers"
# msgstr ""

# msgid "Deploy configuration"
# msgstr ""

# msgid "Allows user to perform “Add”, “Add (advanced)” and “Duplicate” actions on pollers."
# msgstr ""

# msgid "Allows user to delete pollers."
# msgstr ""

# msgid "Allows user to deploy configuration."
# msgstr ""
23 changes: 22 additions & 1 deletion lang/pt_PT.UTF-8/LC_MESSAGES/help.po
Original file line number Diff line number Diff line change
Expand Up @@ -4774,4 +4774,25 @@ msgstr ""
# msgid ""

# msgid "Disacknowledgement command sent"
# msgid ""
# msgid ""

# msgid "Poller Configuration Actions / Poller Management"
# msgstr ""

# msgid "Create and edit pollers"
# msgstr ""

# msgid "Delete pollers"
# msgstr ""

# msgid "Deploy configuration"
# msgstr ""

# msgid "Allows user to perform “Add”, “Add (advanced)” and “Duplicate” actions on pollers."
# msgstr ""

# msgid "Allows user to delete pollers."
# msgstr ""

# msgid "Allows user to deploy configuration."
# msgstr ""
20 changes: 12 additions & 8 deletions www/include/configuration/configServers/listServers.ihtml
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,31 @@
<tr class="ToolbarTR">
<td>
{if !$isRemote}
{if $mode_access == 'w'}
{if $mode_access == 'w' && $can_create_edit == 1}
<a href="{$wizardAddBtn.link}" class="{$wizardAddBtn.class}" isreact="true" target="_top">
{$wizardAddBtn.icon} {$wizardAddBtn.text}
</a>
<a href="{$addBtn.link}" class="{$addBtn.class}">
{$addBtn.icon} {$addBtn.text}
</a>
{/if}
{if $is_admin == 1 || $can_generate == 1}
{if $can_generate == 1}
<button type="button" class="{$exportBtn.class}" name="{$exportBtn.name}"
onClick="{$exportBtn.onClickAction}">
{$exportBtn.icon} {$exportBtn.text}
</button>
{/if}
{if $mode_access == 'w'}
<button type="submit" class="{$duplicateBtn.class}" name="{$duplicateBtn.name}" onClick="{$duplicateBtn.onClickAction}">
{$duplicateBtn.icon} {$duplicateBtn.text}
</button>
<button type="submit" class="{$deleteBtn.class}" name="{$deleteBtn.name}" onClick="{$deleteBtn.onClickAction}">
{$deleteBtn.icon} {$deleteBtn.text}
</button>
{if $can_create_edit == 1}
<button type="submit" class="{$duplicateBtn.class}" name="{$duplicateBtn.name}" onClick="{$duplicateBtn.onClickAction}">
{$duplicateBtn.icon} {$duplicateBtn.text}
</button>
{/if}
{if $can_delete == 1}
<button type="submit" class="{$deleteBtn.class}" name="{$deleteBtn.name}" onClick="{$deleteBtn.onClickAction}">
{$deleteBtn.icon} {$deleteBtn.text}
</button>
{/if}
{/if}
{/if}
</td>
Expand Down
14 changes: 5 additions & 9 deletions www/include/configuration/configServers/listServers.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,9 @@
}

// Get Authorized Actions
if ($is_admin == 0) {
if ($centreon->user->access->checkAction('generate_cfg')) {
$can_generate = 1;
} else {
$can_generate = 0;
}
} else {
$can_generate = 0;
}
$can_generate = $centreon->user->access->checkAction('generate_cfg');
$can_create_edit = $centreon->user->access->checkAction('create_edit_poller_cfg');
$can_delete = $centreon->user->access->checkAction('delete_poller_cfg');

/*
* nagios servers comes from DB
Expand Down Expand Up @@ -382,6 +376,8 @@
$tpl->assign('limit', $limit);
$tpl->assign('searchP', $search);
$tpl->assign("can_generate", $can_generate);
$tpl->assign("can_create_edit", $can_create_edit);
$tpl->assign("can_delete", $can_delete);
$tpl->assign("is_admin", $is_admin);
$tpl->assign("isRemote", $isRemote);

Expand Down
2 changes: 2 additions & 0 deletions www/include/options/accessLists/actionsACL/DB-Func.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ function listActions()
$actions[] = "global_host_obsess";
$actions[] = "global_perf_data";

$actions[] = "create_edit_poller_cfg";
$actions[] = "delete_poller_cfg";
$actions[] = "generate_cfg";
$actions[] = "generate_trap";

Expand Down
39 changes: 28 additions & 11 deletions www/include/options/accessLists/actionsACL/formActionsAccess.ihtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<td class="FormHeader" colspan="2">
<h3>| {$form.header.title}</h3>
</td>
</tr>
</tr>
<tr class="list_lvl_1">
<td class="ListColLvl1_name" colspan="2">
<h4>{$form.header.information}</h4>
Expand All @@ -34,7 +34,7 @@
</td>
</tr>
<tr class="list_one"><td class="FormRowField"><img class="helpTooltip" name="tip_linked_groups">{$form.acl_groups.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.acl_groups.html}</p></td></tr>

<!-- Global -->
<tr class="list_lvl_1">
<td class="ListColLvl1_name" colspan="2">
Expand All @@ -48,12 +48,29 @@
<!-- Config -->
<tr class="list_lvl_1">
<td class="ListColLvl1_name" colspan="2">
<h4>{t}Configuration Actions{/t}</h4>
<h4>{$form.header.poller_cfg_access}</h4>
</td>
</tr>
<tr class="list_one"><td class="FormRowField"><img class="helpTooltip" name="tip_display_generate_cfg">{$form.generate_cfg.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.generate_cfg.html}</p></td></tr>
<tr class="list_one">
<td class="FormRowField"><img class="helpTooltip" name="create_edit_pollers">{$form.create_edit_poller_cfg.label}</td>
<td class="FormRowValue">
<p class="oreonbutton">{$form.create_edit_poller_cfg.html}</p>
</td>
</tr>
<tr class="list_two">
<td class="FormRowField"><img class="helpTooltip" name="delete_pollers">{$form.delete_poller_cfg.label}</td>
<td class="FormRowValue">
<p class="oreonbutton">{$form.delete_poller_cfg.html}</p>
</td>
</tr>
<tr class="list_one">
<td class="FormRowField"><img class="helpTooltip" name="deploy_pollers">{$form.generate_cfg.label}</td>
<td class="FormRowValue">
<p class="oreonbutton">{$form.generate_cfg.html}</p>
</td>
</tr>
<tr class="list_two"><td class="FormRowField"><img class="helpTooltip" name="tip_display_generate_trap">{$form.generate_trap.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.generate_trap.html}</p></td></tr>

<!-- Global External Command -->
<tr class="list_lvl_1">
<td class="ListColLvl1_name" colspan="1">
Expand All @@ -75,7 +92,7 @@
<tr class="list_two engineCheckbox"><td class="FormRowField"><img class="helpTooltip" name="tip_enable_obsessive_service_checks">{$form.global_service_obsess.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.global_service_obsess.html}</p></td></tr>
<tr class="list_one engineCheckbox"><td class="FormRowField"><img class="helpTooltip" name="tip_enable_obsessive_host_checks">{$form.global_host_obsess.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.global_host_obsess.html}</p></td></tr>
<tr class="list_two engineCheckbox"><td class="FormRowField"><img class="helpTooltip" name="tip_enable_performance_data">{$form.global_perf_data.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.global_perf_data.html}</p></td></tr>

<!-- Services -->
<tr class="list_lvl_1">
<td class="ListColLvl1_name" colspan="1">
Expand All @@ -102,7 +119,7 @@
{/if}
<tr class="list_two serviceCheckbox"><td class="FormRowField"><img class="helpTooltip" name="tip_submit_result_for_a_service">{$form.service_submit_result.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.service_submit_result.html}</p></td></tr>
<tr class="list_one serviceCheckbox"><td class="FormRowField"><img class="helpTooltip" name="tip_display_command_for_a_service">{$form.service_display_command.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.service_display_command.html}</p></td></tr>

<!-- Hosts -->
<tr class="list_lvl_1">
<td class="ListColLvl1_name" colspan="1">
Expand All @@ -117,9 +134,9 @@
<tr class="list_two hostCheckbox"><td class="FormRowField"><img class="helpTooltip" name="tip_enable_disable_notifications_for_a_host">{$form.host_notifications.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.host_notifications.html}</p></td></tr>
{/if}
<tr class="list_one hostCheckbox"><td class="FormRowField"><img class="helpTooltip" name="tip_acknowledge_a_host">{$form.host_acknowledgement.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.host_acknowledgement.html}</p></td></tr>
<tr class="list_two hostCheckbox"><td class="FormRowField"><img class="helpTooltip" name="tip_disacknowledge_a_host">{$form.host_disacknowledgement.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.host_disacknowledgement.html}</p></td></tr>
<tr class="list_one hostCheckbox"><td class="FormRowField"><img class="helpTooltip" name="tip_schedule_the_check_for_a_host">{$form.host_schedule_check.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.host_schedule_check.html}</p></td></tr>
<tr class="list_two hostCheckbox"><td class="FormRowField"><img class="helpTooltip" name="tip_schedule_the_check_for_a_host_forced">{$form.host_schedule_forced_check.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.host_schedule_forced_check.html}</p></td></tr>
<tr class="list_two hostCheckbox"><td class="FormRowField"><img class="helpTooltip" name="tip_disacknowledge_a_host">{$form.host_disacknowledgement.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.host_disacknowledgement.html}</p></td></tr>
<tr class="list_one hostCheckbox"><td class="FormRowField"><img class="helpTooltip" name="tip_schedule_the_check_for_a_host">{$form.host_schedule_check.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.host_schedule_check.html}</p></td></tr>
<tr class="list_two hostCheckbox"><td class="FormRowField"><img class="helpTooltip" name="tip_schedule_the_check_for_a_host_forced">{$form.host_schedule_forced_check.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.host_schedule_forced_check.html}</p></td></tr>
<tr class="list_one hostCheckbox"><td class="FormRowField"><img class="helpTooltip" name="tip_schedule_downtime_for_a_host">{$form.host_schedule_downtime.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.host_schedule_downtime.html}</p></td></tr>
<tr class="list_two hostCheckbox"><td class="FormRowField"><img class="helpTooltip" name="tip_add_delete_a_comment_for_a_host">{$form.host_comment.label}</td><td class="FormRowValue"><p class="oreonbutton">{$form.host_comment.html}</p></td></tr>
{if $serverIsMaster}
Expand All @@ -136,7 +153,7 @@
</td>
</tr>
<tr class="list_one"><td class="FormRowField"><img class="helpTooltip" name="tip_status">{$form.acl_action_activate.label}</td><td class="FormRowValue">{$form.acl_action_activate.html}</td></tr>

{if $o == "a" || $o == "c"}
<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">
{if isset($form.required)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@
$form->addElement('checkbox', 'poller_listing', _("Display Poller Listing"));

// Configuration Actions
$form->addElement('checkbox', 'generate_cfg', _("Generate Configuration Files"));
$form->addElement('checkbox', 'create_edit_poller_cfg', _("Create and edit pollers"));
$form->addElement('checkbox', 'delete_poller_cfg', _("Delete pollers"));
$form->addElement('checkbox', 'generate_cfg', _("Deploy configuration Files"));
$form->addElement('checkbox', 'generate_trap', _("Generate SNMP Trap configuration"));

$form->addElement('checkbox', 'all_service', "");
Expand All @@ -189,6 +191,7 @@
$form->addElement('header', 'host_actions', _("Hosts Actions Access"));
$form->addElement('header', 'global_actions', _("Global Monitoring Engine Actions (External Process Commands)"));
$form->addElement('header', 'global_access', _("Global Functionalities Access"));
$form->addElement('header', 'poller_cfg_access', _("Poller Configuration Actions / Poller Management"));

$ams1 = $form->addElement('advmultiselect', 'acl_groups', _("Linked Groups"), $groups, $attrsAdvSelect, SORT_ASC);
$ams1->setButtonAttributes('add', array('value' => _("Add"), "class" => "btc bt_success"));
Expand Down
14 changes: 11 additions & 3 deletions www/include/options/accessLists/actionsACL/help.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,19 @@
);

/**
* Generation of files
* Poller configuration - Generation of configuration files
*/
$help['tip_display_generate_cfg'] = dgettext(
$help['create_edit_pollers'] = dgettext(
'help',
'Allows user to generate and export configuration, and restart poller.'
'Allows user to perform “Add”, “Add (advanced)” and “Duplicate” actions on pollers.'
);
$help['delete_pollers'] = dgettext(
'help',
'Allows user to delete pollers.'
);
$help['deploy_pollers'] = dgettext(
'help',
'Allows user to deploy configuration.'
);
$help['tip_display_generate_trap'] = dgettext(
'help',
Expand Down

0 comments on commit 1afb472

Please sign in to comment.