@@ -122,7 +122,7 @@ if (my ($category_action) = grep { $_ =~ /^categoryAction-(?:\w+)$/ } $cgi->para
122122 }
123123 }
124124
125- $vars -> {' groups' } = [Bugzilla::Group -> get_all] ;
125+ $vars -> {' groups' } = get_settable_groups() ;
126126 $vars -> {' action' } = $action ;
127127
128128 my $type = {};
@@ -226,7 +226,7 @@ if ($action eq 'enter') {
226226 if $user -> in_group(' editcomponents' );
227227 $vars -> {' can_fully_edit' } = 1;
228228 # Get a list of groups available to restrict this flag type against.
229- $vars -> {' groups' } = [Bugzilla::Group -> get_all] ;
229+ $vars -> {' groups' } = get_settable_groups() ;
230230
231231 $template -> process(" admin/flag-type/edit.html.tmpl" , $vars )
232232 || ThrowTemplateError($template -> error());
@@ -258,7 +258,7 @@ if ($action eq 'edit' || $action eq 'copy') {
258258 }
259259
260260 # Get a list of groups available to restrict this flag type against.
261- $vars -> {' groups' } = [Bugzilla::Group -> get_all] ;
261+ $vars -> {' groups' } = get_settable_groups() ;
262262
263263 $template -> process(" admin/flag-type/edit.html.tmpl" , $vars )
264264 || ThrowTemplateError($template -> error());
@@ -490,6 +490,12 @@ sub get_editable_flagtypes {
490490 return $flagtypes ;
491491}
492492
493+ sub get_settable_groups {
494+ my $user = Bugzilla-> user;
495+ my $groups = $user -> in_group(' editcomponents' ) ? [Bugzilla::Group-> get_all] : $user -> groups;
496+ return $groups ;
497+ }
498+
493499sub filter_group {
494500 my ($flag_types , $gid ) = @_ ;
495501 return $flag_types unless $gid ;
0 commit comments