diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 8843113205..e46ce44588 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1119,11 +1119,13 @@ function events_get_all( } } - if (!$user_is_admin && users_can_manage_group_all('ER') === false) { - $ER_groups = users_get_groups($config['id_user'], 'ER', true); + if (!$user_is_admin && users_can_manage_group_all('EM') === false) { $EM_groups = users_get_groups($config['id_user'], 'EM', true, true); $EW_groups = users_get_groups($config['id_user'], 'EW', true, true); + } + if (!$user_is_admin && users_can_manage_group_all('ER') === false) { + $ER_groups = users_get_groups($config['id_user'], 'ER', true); // Get groups where user have ER grants. if ((bool) $filter['search_secondary_groups'] === true) { $sql_filters[] = sprintf( @@ -1690,7 +1692,7 @@ function events_get_all( } } - if (!$user_is_admin && users_can_manage_group_all('ER') === false) { + if (!$user_is_admin && users_can_manage_group_all('EM') === false) { $exists_id_grupo = false; foreach ($fields as $field) { if (str_contains($field, 'te.id_grupo') === true || str_contains($field, 'te.*') === true) { @@ -1814,7 +1816,7 @@ function events_get_all( return $sql; } - if (!$user_is_admin && users_can_manage_group_all('ER') === false) { + if (!$user_is_admin && users_can_manage_group_all('EM') === false) { $can_manage = '0 as user_can_manage'; if (empty($EM_groups) === false) { $can_manage = sprintf( diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 651b4be227..ee2f7fa1a5 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -2645,20 +2645,22 @@ try { // Always add options column. - $fields = array_merge( - $fields, - [ + if ((bool) check_acl($config['id_user'], 0, 'EW') === true) { + $fields = array_merge( + $fields, [ - 'text' => 'options', - 'class' => 'table_action_buttons mw100px', - ], - [ - 'text' => 'm', - 'extra' => $checkbox_all, - 'class' => 'w20px no-text-imp', - ], - ] - ); + [ + 'text' => 'options', + 'class' => 'table_action_buttons mw100px', + ], + [ + 'text' => 'm', + 'extra' => $checkbox_all, + 'class' => 'w20px no-text-imp', + ], + ] + ); + } // Get column names. $column_names = events_get_column_names($fields, true); @@ -2869,8 +2871,8 @@ try { 'column_names' => $column_names, 'columns' => $fields, 'no_sortable_columns' => [ - -1, - -2, + 'options', + 'm', 'column-instructions', 'user_comment', ],