changes in dashboard permissions

This commit is contained in:
alejandro-campos 2021-01-21 14:42:43 +01:00
parent d697ffb703
commit 983d58260d
8 changed files with 12 additions and 3 deletions

View File

@ -4778,7 +4778,11 @@ function html_print_input($data, $wrapper='div', $input_only=false)
}
if ($data['from_wux'] === true) {
$string_filter = ' AND id_tipo_modulo = 25 ';
$string_filter = ' AND id_tipo_modulo = 25';
}
if (isset($data['filter_modules']) && !empty($data['filter_modules'])) {
$string_filter = ' AND id_agente_modulo IN ('.implode(',', $data['filter_modules']).')';
}
$sql = sprintf(

View File

@ -367,7 +367,7 @@ class EventsListWidget extends Widget
$return_all_group = false;
$selected_groups_array = explode(',', $values['groupId'][0]);
if (users_can_manage_group_all('RM') || in_array(0, $selected_groups_array) === true) {
if (users_can_manage_group_all('RM') || ($selected_groups_array[0] !== '' && in_array(0, $selected_groups_array) === true)) {
// Return all group if user has permissions or it is a currently selected group.
$return_all_group = true;
}

View File

@ -312,6 +312,7 @@ class GraphModuleHistogramWidget extends Widget
'agent_id' => $values['agentId'],
'metaconsole_id' => $values['metaconsoleId'],
'style' => 'width: inherit;',
'filter_modules' => users_access_to_agent($values['agentId']) === false ? [$values['moduleId']] : [],
],
];

View File

@ -278,7 +278,7 @@ class GroupsStatusWidget extends Widget
$url .= '&refr=60&group_id='.$this->values['groupId'];
$data .= '<h1>';
$data .= '<a href="'.$url.'">';
$data .= $user_groups[$this->values['groupId']];
$data .= groups_get_name($this->values['groupId']);
$data .= '</a>';
$data .= '</h1></div>';

View File

@ -342,6 +342,7 @@ class ModuleIconWidget extends Widget
'agent_id' => $values['agentId'],
'metaconsole_id' => $values['metaconsoleId'],
'style' => 'width: inherit;',
'filter_modules' => users_access_to_agent($values['agentId']) === false ? [$values['moduleId']] : [],
],
];

View File

@ -332,6 +332,7 @@ class ModuleStatusWidget extends Widget
'agent_id' => $values['agentId'],
'metaconsole_id' => $values['metaconsoleId'],
'style' => 'width: inherit;',
'filter_modules' => users_access_to_agent($values['agentId']) === false ? [$values['moduleId']] : [],
],
];

View File

@ -291,6 +291,7 @@ class ModuleTableValueWidget extends Widget
'agent_id' => $values['agentId'],
'metaconsole_id' => $values['metaconsoleId'],
'style' => 'width: inherit;',
'filter_modules' => users_access_to_agent($values['agentId']) === false ? [$values['moduleId']] : [],
],
];

View File

@ -316,6 +316,7 @@ class ModuleValueWidget extends Widget
'agent_id' => $values['agentId'],
'metaconsole_id' => $values['metaconsoleId'],
'style' => 'width: inherit;',
'filter_modules' => users_access_to_agent($values['agentId']) === false ? [$values['moduleId']] : [],
],
];