Commit 135afc0a authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 1071033: Variable "$user" will not stay shared at buglist.cgi

r=dkl a=sgreen
parent 03c85287
...@@ -283,6 +283,7 @@ sub GetGroups { ...@@ -283,6 +283,7 @@ sub GetGroups {
sub _get_common_flag_types { sub _get_common_flag_types {
my $component_ids = shift; my $component_ids = shift;
my $user = Bugzilla->user;
# Get all the different components in the bug list # Get all the different components in the bug list
my $components = Bugzilla::Component->new_from_list($component_ids); my $components = Bugzilla::Component->new_from_list($component_ids);
...@@ -303,12 +304,10 @@ sub _get_common_flag_types { ...@@ -303,12 +304,10 @@ sub _get_common_flag_types {
if $flag_type_count == scalar @$components; if $flag_type_count == scalar @$components;
} }
# We only show flags that a user has request or set rights on # We only show flags that a user can request.
my @show_flag_types my @show_flag_types
= grep { $user->can_request_flag($_) || $user->can_set_flag($_) } = grep { $user->can_request_flag($_) } values %common_flag_types;
values %common_flag_types; my $any_flags_requesteeble = grep { $_->is_requesteeble } @show_flag_types;
my $any_flags_requesteeble =
grep($_->is_requesteeble, @show_flag_types);
return(\@show_flag_types, $any_flags_requesteeble); return(\@show_flag_types, $any_flags_requesteeble);
} }
......
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