Commit 1633d983 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 486881: A powerless user can still see a restricted bug when he removes all…

Bug 486881: A powerless user can still see a restricted bug when he removes all his roles related to the bug - Patch by Fré©ric Buclin <LpSolit@gmail.com> r/a=mkanat
parent 2ee6d9a1
...@@ -876,6 +876,10 @@ sub update { ...@@ -876,6 +876,10 @@ sub update {
delete $self->{'_old_assigned_to'}; delete $self->{'_old_assigned_to'};
delete $self->{'_old_qa_contact'}; 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; return $changes;
} }
......
...@@ -588,6 +588,8 @@ sub visible_bugs { ...@@ -588,6 +588,8 @@ sub visible_bugs {
# We only check the visibility of bugs that we haven't # We only check the visibility of bugs that we haven't
# checked yet. # 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 $visible_cache = $self->{_visible_bugs_cache} ||= {};
my @check_ids = grep(!exists $visible_cache->{$_}, @bug_ids); my @check_ids = grep(!exists $visible_cache->{$_}, @bug_ids);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment