diff --git a/pandora_console/godmode/events/event_edit_filter.php b/pandora_console/godmode/events/event_edit_filter.php index 50461f9bbd..02384c17ec 100644 --- a/pandora_console/godmode/events/event_edit_filter.php +++ b/pandora_console/godmode/events/event_edit_filter.php @@ -277,7 +277,7 @@ if ($strict_user) { } else { $users = users_get_user_users($config['id_user'], "ER", - users_can_manage_group_all()); + users_can_manage_group_all(0)); } $table->data[10][1] = html_print_select($users, "id_user_ack", diff --git a/pandora_console/godmode/reporting/reporting_builder.main.php b/pandora_console/godmode/reporting/reporting_builder.main.php index 37e32d8621..65f1eec4e1 100755 --- a/pandora_console/godmode/reporting/reporting_builder.main.php +++ b/pandora_console/godmode/reporting/reporting_builder.main.php @@ -69,7 +69,7 @@ $table->data['name'][1] = html_print_input_text('name', $reportName, $table->data['group'][0] = __('Group'); $write_groups = users_get_groups_for_select(false, "RW", - users_can_manage_group_all("RW"), true, false, 'id_grupo'); + users_can_manage_group_all(0, "RW"), true, false, 'id_grupo'); // If the report group is not among the RW groups (special permission) we add it if (!isset($write_groups[$idGroupReport]) && $idGroupReport) { diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 55cede0f66..113bac230b 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -373,7 +373,9 @@ switch ($action) { $delete = true; //owner can delete } else { $delete = check_acl($config['id_user'], - $report['id_group'], "RM"); + $report['id_group'], "RM") + && + users_can_manage_group_all($report["id_group"], "RM"); } break; case 'group_edit': @@ -381,7 +383,9 @@ switch ($action) { $delete = true; //owner can delete } else { $delete = check_acl($config['id_user'], - $report['id_group'], "RM"); + $report['id_group'], "RM") + && + users_can_manage_group_all($report["id_group"], "RM"); } break; case 'user_edit': @@ -587,7 +591,7 @@ switch ($action) { $data = array (); - if (check_acl ($config["id_user"], $report["id_group"], "RW")) { + if (check_acl ($config["id_user"], $report["id_group"], "RW") && users_can_manage_group_all($report["id_group"])) { $data[0] = ''.$report['name'].''; } @@ -648,7 +652,9 @@ switch ($action) { switch ($type_access_selected) { case 'group_view': $edit = check_acl($config['id_user'], - $report['id_group'], "RW"); + $report['id_group'], "RW") + && + users_can_manage_group_all($report["id_group"], "RW"); if ($config['id_user'] == $report['id_user'] || is_user_admin ($config["id_user"])) { $delete = true; //owner can delete @@ -658,13 +664,17 @@ switch ($action) { break; case 'group_edit': $edit = check_acl($config['id_user'], - $report['id_group_edit'], "RW"); + $report['id_group_edit'], "RW") + && + users_can_manage_group_all($report["id_group_edit"], "RW"); if ($config['id_user'] == $report['id_user'] || is_user_admin ($config["id_user"])) { $delete = true; //owner can delete } else { $delete = check_acl($config['id_user'], - $report['id_group'], "RM"); + $report['id_group'], "RM") + && + users_can_manage_group_all($report["id_group"], "RM"); } break; case 'user_edit': diff --git a/pandora_console/include/functions_users.php b/pandora_console/include/functions_users.php index c3717cb12b..8a5f4ca61f 100755 --- a/pandora_console/include/functions_users.php +++ b/pandora_console/include/functions_users.php @@ -821,9 +821,13 @@ function users_check_users() { // Check if a user can manage a group when group is all // This function dont check acls of the group, only if the // user is admin or pandora manager and the group is all -function users_can_manage_group_all($access = "PM") { +function users_can_manage_group_all($id_group = 0, $access = "PM") { global $config; + if ($id_group != 0) { + return true; + } + $is_admin = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']); if (check_acl ($config['id_user'], 0, $access) || $is_admin) { diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index e544485395..371041eff0 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -427,7 +427,7 @@ $data[0] = __('User ack.') . $jump; if ($strict_user) { $user_users = array($config['id_user']=>$config['id_user']); } else { - $user_users = users_get_user_users($config['id_user'], "ER", users_can_manage_group_all()); + $user_users = users_get_user_users($config['id_user'], "ER", users_can_manage_group_all(0)); } $data[0] .= html_print_select($user_users, "id_user_ack", $id_user_ack, '', @@ -467,7 +467,7 @@ $table_advanced->rowclass[] = ''; $data = array(); $data[0] = __('Date from') . $jump; -$user_users = users_get_user_users($config['id_user'], "ER", users_can_manage_group_all()); +$user_users = users_get_user_users($config['id_user'], "ER", users_can_manage_group_all(0)); $data[0] .= html_print_input_text ('date_from', $date_from, '', 15, 10, true); @@ -494,13 +494,13 @@ if (defined('METACONSOLE')) ''; } else { - $data[0] = '