From: lpsolit%gmail.com <> Date: Mon, 6 Apr 2009 20:04:47 +0000 (+0000) Subject: Bug 486881: A powerless user can still see a restricted bug when he removes all his... X-Git-Tag: bugzilla-3.4rc1~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7da7420c96a4ff323a26eb5597f8caaa22208ef6;p=thirdparty%2Fbugzilla.git Bug 486881: A powerless user can still see a restricted bug when he removes all his roles related to the bug - Patch by Frédéric Buclin r=mkanat a=LpSolit --- diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 5038275c86..79cf1dd5e2 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -876,6 +876,10 @@ sub update { delete $self->{'_old_assigned_to'}; delete $self->{'_old_qa_contact'}; + # Also flush the visible_bugs cache for this bug as the user's + # relationship with this bug may have changed. + delete Bugzilla->user->{_visible_bugs_cache}->{$self->id}; + return $changes; } diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index fe04856aa6..603511910e 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -588,6 +588,8 @@ sub visible_bugs { # We only check the visibility of bugs that we haven't # checked yet. + # Bugzilla::Bug->update automatically removes updated bugs + # from the cache to force them to be checked again. my $visible_cache = $self->{_visible_bugs_cache} ||= {}; my @check_ids = grep(!exists $visible_cache->{$_}, @bug_ids);