From 223bd464bdfc6bcdff59e698ff3875eed7988207 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Thu, 5 Jul 2007 02:05:58 +0000 Subject: Bug 339437: Make flag requestee a select box and limit users to requestable only - Patch by Seth r/a=LpSolit --- Bugzilla/FlagType.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Bugzilla/FlagType.pm') diff --git a/Bugzilla/FlagType.pm b/Bugzilla/FlagType.pm index 1504be87d..ffa36863e 100644 --- a/Bugzilla/FlagType.pm +++ b/Bugzilla/FlagType.pm @@ -186,6 +186,11 @@ sub sortkey { return $_[0]->{'sortkey'}; } =over +=item C + +Returns a reference to an array of users who have permission to grant this flag type. +The arrays are populated with hashrefs containing the login, identity and visibility of users. + =item C Returns the group (as a Bugzilla::Group object) in which a user @@ -214,6 +219,17 @@ explicitly excluded from the flagtype. =cut +sub grant_list { + my $self = shift; + my @custusers; + my @allusers = @{Bugzilla->user->get_userlist}; + foreach my $user (@allusers) { + my $user_obj = new Bugzilla::User({name => $user->{login}}); + push(@custusers, $user) if $user_obj->can_set_flag($self); + } + return \@custusers; +} + sub grant_group { my $self = shift; -- cgit v1.2.3-24-g4f1b