[Rt-commit] rt branch 5.0/make-owngroups-optionally-recursive created. rt-5.0.5-118-gac7cdb9b4d

BPS Git Server git at git.bestpractical.com
Fri Jan 12 19:47:10 UTC 2024


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/make-owngroups-optionally-recursive has been created
        at  ac7cdb9b4dbb175e8f36d1c63df46c53546f3aca (commit)

- Log -----------------------------------------------------------------
commit ac7cdb9b4dbb175e8f36d1c63df46c53546f3aca
Author: Jason Crome <jcrome at bestpractical.com>
Date:   Fri Jan 12 14:39:38 2024 -0500

    Make RT::User::OwnGroups() optionally recursive
    
    When $SelfServiceShowGroupTickets is set to 1, the My Group Tickets
    portlet in self-service would recursively search for all of a user's
    group memberships. In some cases, this could degrade search performance
    by trying to return tickets belonging to other groups. By making
    OwnGroups() optionally recursive, both issues are avoided.

diff --git a/lib/RT/User.pm b/lib/RT/User.pm
index 4a881003bc..af59aa2c3e 100644
--- a/lib/RT/User.pm
+++ b/lib/RT/User.pm
@@ -1570,11 +1570,15 @@ user is a member.
 
 sub OwnGroups {
     my $self = shift;
+    my %args = (
+        Recursively => 1,
+        @_    # get the real argumentlist
+    );
     my $groups = RT::Groups->new($self->CurrentUser);
     $groups->LimitToUserDefinedGroups;
     $groups->WithMember(
         PrincipalId => $self->Id,
-        Recursively => 1
+        Recursively => $args{ Recursively },
     );
     return $groups;
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list