[Rt-commit] rt branch, dashboard-acl-query, created. rt-3.9.6-365-g0755275

Shawn Moore sartak at bestpractical.com
Mon Dec 6 16:17:18 EST 2010


The branch, dashboard-acl-query has been created
        at  0755275d38687dd96d67f331cc4f90c25ba50974 (commit)

- Log -----------------------------------------------------------------
commit 0755275d38687dd96d67f331cc4f90c25ba50974
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Dec 6 16:16:59 2010 -0500

    RT::Groups->ForWhichCurrentUserHasRight

diff --git a/lib/RT/Groups_Overlay.pm b/lib/RT/Groups_Overlay.pm
index 252b3e2..dfa64cf 100755
--- a/lib/RT/Groups_Overlay.pm
+++ b/lib/RT/Groups_Overlay.pm
@@ -332,6 +332,23 @@ sub _GetEquivObjects          { return (shift)->RT::Users::_GetEquivObjects( @_
 sub WithGroupRight            { return (shift)->RT::Users::WhoHaveGroupRight( @_ ) }
 sub WithRoleRight             { return (shift)->RT::Users::WhoHaveRoleRight( @_ ) }
 
+sub ForWhichCurrentUserHasRight {
+    my $self = shift;
+    my %args = (
+        Right => undef,
+        IncludeSuperusers => undef,
+        @_,
+    );
+
+    $self->WithMember(
+        PrincipalId => $self->CurrentUser->Id,
+        Recursively => 1,
+    );
+
+    $self->_JoinACL( %args );
+
+    return;
+}
 
 =head2 LimitToEnabled
 

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


More information about the Rt-commit mailing list