summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-08-24 19:44:36 +0200
committerByron Jones <glob@mozilla.com>2015-08-24 19:44:36 +0200
commitc63ecc86155c5bb6fb85e6412fe7c6e80ba33a65 (patch)
tree8ad223b0d9b3006c3ba454a74ea3cc6500989b21 /Bugzilla
parent24e4c03268aa627947f73703f4c283b9b8087d5e (diff)
downloadbugzilla-c63ecc86155c5bb6fb85e6412fe7c6e80ba33a65.tar.gz
bugzilla-c63ecc86155c5bb6fb85e6412fe7c6e80ba33a65.tar.xz
Bug 1197696 - group_members report doesn't display nested inherited groups
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Group.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/Bugzilla/Group.pm b/Bugzilla/Group.pm
index 732de348f..bb84ca229 100644
--- a/Bugzilla/Group.pm
+++ b/Bugzilla/Group.pm
@@ -107,6 +107,27 @@ sub members_non_inherited {
return $self->{members_non_inherited};
}
+# returns all possible members of groups, keyed by the group name or _direct
+# a user present in multiple groups will be returned multiple times
+sub members_complete {
+ my ($self) = @_;
+ my $dbh = Bugzilla->dbh;
+ require Bugzilla::User;
+
+ my $sth = $dbh->prepare(
+ "SELECT DISTINCT user_id FROM user_group_map WHERE isbless = 0 AND group_id = ?"
+ );
+
+ my $result = { _direct => $self->members_direct() };
+ foreach my $group_id (@{ $self->flatten_group_membership($self->id) }) {
+ next if $group_id == $self->id;
+ my $group_name = Bugzilla::Group->new({ id => $group_id, cache => 1 })->name;
+ my $user_ids = $dbh->selectcol_arrayref($sth, undef, $group_id);
+ $result->{$group_name} = Bugzilla::User->new_from_list($user_ids);
+ }
+ return $result;
+}
+
# A helper for members_direct and members_non_inherited
sub _get_members {
my ($self, $grant_type) = @_;