From: lpsolit%gmail.com <> Date: Mon, 26 Sep 2005 03:54:38 +0000 (+0000) Subject: Bug 303784: Visibility can keep admin from administering groups - Patch by Joel Peshk... X-Git-Tag: bugzilla-2.20~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65f3a984731197f22e34dd921f5714b3f5f591c3;p=thirdparty%2Fbugzilla.git Bug 303784: Visibility can keep admin from administering groups - Patch by Joel Peshkin r=LpSolit a=justdave --- diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 639da0c371..cb3ac3dba2 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -325,7 +325,7 @@ sub bless_groups { } # If visibilitygroups are used, restrict the set of groups. - if (Param('usevisibilitygroups')) { + if ((!$self->in_group('editusers')) && Param('usevisibilitygroups')) { # Users need to see a group in order to bless it. my $visibleGroups = join(', ', @{$self->visible_groups_direct()}) || return $self->{'bless_groups'} = []; diff --git a/editusers.cgi b/editusers.cgi index f4eb5afae5..3eb0061e05 100755 --- a/editusers.cgi +++ b/editusers.cgi @@ -83,7 +83,7 @@ if ($action eq 'search') { my $nextCondition; my $visibleGroups; - if (Param('usevisibilitygroups')) { + if (!$editusers && Param('usevisibilitygroups')) { # Show only users in visible groups. $visibleGroups = visibleGroupsAsString(); @@ -197,7 +197,7 @@ if ($action eq 'search') { $otherUser || ThrowCodeError('invalid_user_id', {'userid' => $cgi->param('userid')}); - canSeeUser($otherUserID) + $editusers || canSeeUser($otherUserID) || ThrowUserError('auth_failure', {reason => "not_visible", action => "modify", object => "user"}); @@ -228,7 +228,7 @@ if ($action eq 'search') { 'group_group_map READ', 'group_group_map AS ggm READ'); - canSeeUser($otherUserID) + $editusers || canSeeUser($otherUserID) || ThrowUserError('auth_failure', {reason => "not_visible", action => "modify", object => "user"}); @@ -396,11 +396,6 @@ if ($action eq 'search') { $editusers || ThrowUserError('auth_failure', {group => "editusers", action => "delete", object => "users"}); - canSeeUser($otherUserID) || ThrowUserError('auth_failure', - {reason => "not_visible", - action => "delete", - object => "user"}); - $vars->{'otheruser'} = $otherUser; $vars->{'editcomponents'} = UserInGroup('editcomponents'); @@ -506,10 +501,6 @@ if ($action eq 'search') { {group => "editusers", action => "delete", object => "users"}); - canSeeUser($otherUserID) || ThrowUserError('auth_failure', - {reason => "not_visible", - action => "delete", - object => "user"}); @{$otherUser->product_responsibilities()} && ThrowUserError('user_has_responsibility');