summaryrefslogtreecommitdiffstats
path: root/Bugzilla/FlagType.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/FlagType.pm')
-rw-r--r--Bugzilla/FlagType.pm16
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;