diff --git a/lib/RT/User.pm b/lib/RT/User.pm index 4a881003bca..b62b3f9da9f 100644 --- a/lib/RT/User.pm +++ b/lib/RT/User.pm @@ -1561,20 +1561,24 @@ sub HasGroupRight { return ($retval); } -=head2 OwnGroups +=head2 OwnGroups Recursively => 1|0 Returns a group collection object containing the groups of which this -user is a member. +user is a member, recursively by default. =cut sub OwnGroups { my $self = shift; + my %args = ( + Recursively => 1, + @_, + ); my $groups = RT::Groups->new($self->CurrentUser); $groups->LimitToUserDefinedGroups; $groups->WithMember( PrincipalId => $self->Id, - Recursively => 1 + Recursively => $args{'Recursively'}, ); return $groups; } diff --git a/share/html/SelfService/Elements/MyGroupRequests b/share/html/SelfService/Elements/MyGroupRequests index 96d730a7834..68ad9519c92 100644 --- a/share/html/SelfService/Elements/MyGroupRequests +++ b/share/html/SelfService/Elements/MyGroupRequests @@ -75,7 +75,7 @@ unless ( $ret ){ RT::Logger->error("Unable to load user record for user: " . $session{'CurrentUser'}->Name . " :$msg"); return; } -my $groups_obj = $user->OwnGroups; +my $groups_obj = $user->OwnGroups( Recursively => 0 ); my $Query = '';