Remove the 'All Groups' option in non-administrators users

This commit is contained in:
manuel.montes 2018-07-03 13:11:00 +02:00
parent 95678f706b
commit 54a74c43d0
3 changed files with 11 additions and 7 deletions

View File

@ -224,9 +224,9 @@ $table->data[1][1] = html_print_select_groups(
'', false, '', false, false, 'id_grupo', $strict_user);
$table->data[2][0] = '<b>' . __('Group').'</b>';
$table->data[2][1] = html_print_select_groups($config["id_user"], $access,
true, 'id_group', $id_group, '', '', -1, true, false, false, '',
false, false, false, false, 'id_grupo', $strict_user);
$display_all_group = (users_is_admin() || users_can_manage_group_all("AR"));
$table->data[2][1] = html_print_select_groups($config['id_user'], "AR",
$display_all_group, 'id_group', $idGroup, '', '', '', true);
$types = get_event_types ();
// Expand standard array to add not_normal (not exist in the array, used only for searches)

View File

@ -119,9 +119,9 @@ $own_info = get_user_info ($config['id_user']);
echo "<td><b>".__('Group')."</b></td><td>";
if (check_acl ($config['id_user'], 0, "RW"))
echo html_print_select_groups($config['id_user'], 'RW', true, 'graph_id_group', $id_group, '', '', '', true);
echo html_print_select_groups($config['id_user'], 'RW', $display_all_group, 'graph_id_group', $id_group, '', '', '', true);
elseif (check_acl ($config['id_user'], 0, "RM"))
echo html_print_select_groups($config['id_user'], 'RM', true, 'graph_id_group', $id_group, '', '', '', true);
echo html_print_select_groups($config['id_user'], 'RM', $display_all_group, 'graph_id_group', $id_group, '', '', '', true);
echo "</td></tr>";
echo "<tr>";
echo "<td class='datos2'><b>".__('Description')."</b></td>";

View File

@ -67,10 +67,14 @@ $table->data['name'][1] = html_print_input_text('name', $reportName,
__('Name'), 80, 100, true, false, true);
$table->data['group'][0] = __('Group');
$display_all_group = (users_is_admin() || users_can_manage_group_all("AR"));
$write_groups = users_get_groups_for_select(false, "AR", $display_all_group, true, false, 'id_grupo');
$write_groups = users_get_groups_for_select(false, "RW",
true, true, false, 'id_grupo');
html_print_select_groups($config['id_user'], "AR",
$display_all_group, 'id_group', $idGroup, '', '', '', true);
// If the report group is not among the RW groups (special permission) we add it
if (!isset($write_groups[$idGroupReport]) && $idGroupReport) {
$write_groups[$idGroupReport] = groups_get_name($idGroupReport);