diff options
author | lpsolit%gmail.com <> | 2007-07-05 04:05:58 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2007-07-05 04:05:58 +0200 |
commit | 223bd464bdfc6bcdff59e698ff3875eed7988207 (patch) | |
tree | 28e29367981b5104f829afe8b9405b2d52596737 /Bugzilla/FlagType.pm | |
parent | 09b34ef6593a89e0e9a364fe73a2b1aed80741e7 (diff) | |
download | bugzilla-223bd464bdfc6bcdff59e698ff3875eed7988207.tar.gz bugzilla-223bd464bdfc6bcdff59e698ff3875eed7988207.tar.xz |
Bug 339437: Make flag requestee a select box and limit users to requestable only - Patch by Seth <laoseth@gmail.com> r/a=LpSolit
Diffstat (limited to 'Bugzilla/FlagType.pm')
-rw-r--r-- | Bugzilla/FlagType.pm | 16 |
1 files changed, 16 insertions, 0 deletions
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<grant_list> + +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<grant_group> 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; |