Merge branch 'ent-13554-perfil-con-aw-no-puede-crear-agentes-de-satellite-ni-desplegar-coleciones-a-satellite-desde' into 'develop'

Ent 13554 perfil con aw no puede crear agentes de satellite ni desplegar coleciones a satellite desde

See merge request artica/pandorafms!7263
This commit is contained in:
Juan Antonio Loarte 2024-04-25 14:35:33 +00:00
commit c0dbbe631f
5 changed files with 27 additions and 16 deletions

View File

@ -473,6 +473,13 @@ if ($access_console_node === true) {
enterprise_hook('translate_string_submenu');
$menu_godmode['gsetup']['sub'] = $sub;
} else if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
$menu_godmode['gservers']['text'] = __('Servers');
$menu_godmode['gservers']['sec2'] = 'godmode/servers/modificar_server';
$menu_godmode['gservers']['id'] = 'god-servers';
$sub = [];
enterprise_hook('manage_satellite_submenu');
$menu_godmode['gservers']['sub'] = $sub;
}
}

View File

@ -34,7 +34,7 @@ require_once $config['homedir'].'/include/functions_graph.php';
check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
if (! check_acl($config['id_user'], 0, 'PM') && ((bool) check_acl($config['id_user'], 0, 'AW') === true && $_GET['server_remote'] === null)) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Server Management'
@ -286,19 +286,21 @@ if (isset($_GET['server']) === true) {
$id_server
);
$buttons = '';
$buttons = [];
// Buttons.
$buttons = [
'standard_editor' => [
'active' => false,
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=standard_editor&pure='.$pure.'">'.html_print_image('images/list.png', true, ['title' => __('Standard editor')]).'</a>',
],
'advanced_editor' => [
'active' => false,
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=advanced_editor&pure='.$pure.'">'.html_print_image('images/pen.png', true, ['title' => __('Advanced editor')]).'</a>',
],
];
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$buttons = [
'standard_editor' => [
'active' => false,
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=standard_editor&pure='.$pure.'">'.html_print_image('images/list.png', true, ['title' => __('Standard editor')]).'</a>',
],
'advanced_editor' => [
'active' => false,
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=advanced_editor&pure='.$pure.'">'.html_print_image('images/pen.png', true, ['title' => __('Advanced editor')]).'</a>',
],
];
}
if ($server_type === SERVER_TYPE_ENTERPRISE_SATELLITE) {
$buttons['agent_editor'] = [

View File

@ -28,7 +28,9 @@
// Begin.
require_once 'include/functions_clippy.php';
require_once 'pending_alerts_list.php';
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
include 'pending_alerts_list.php';
}
global $config;

View File

@ -553,7 +553,6 @@ class SatelliteCollection extends HTML
},
datatype: "json",
success: function(data) {
console.log(data);
showMsg(data);
},
error: function(e) {
@ -596,7 +595,6 @@ class SatelliteCollection extends HTML
},
datatype: "json",
success: function(data) {
console.log(data);
showMsg(data);
},
error: function(e) {
@ -615,7 +613,7 @@ class SatelliteCollection extends HTML
function showMsg(data) {
var title = "<?php echo __('Success'); ?>";
var dt_satellite_agents = $("#satellite_collections").DataTable();
dt_<?php echo $this->tableId; ?>.draw(false);
dt_satellite_agents.draw(false);
var text = '';
var failed = 0;

View File

@ -169,6 +169,8 @@ function menu_print_menu(&$menu)
$sec2 = 'godmode/users/profile_list';
} else if ($sec2 === 'godmode/users/configure_token') {
$sec2 = 'godmode/users/token_list';
} else if ($sec2 === 'godmode/servers/modificar_server' && check_acl($config['id_user'], 0, 'AW') && (bool) check_acl($config['id_user'], 0, 'PM') === false) {
$sec2 = 'enterprise/godmode/servers/list_satellite';
} else {
$sec2 = (string) get_parameter('sec2');
}