X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FACL.pm;fp=rt%2Flib%2FRT%2FACL.pm;h=83423ad9e295f56111dc2555e07fa55d3f1b22c1;hb=31f3763747b82764bb019cfab5b2a2945fc9a99d;hp=0662b3955b0c55822902f9b2b6a59ecae96cebf5;hpb=5e9677cbad2051ea452b389fa03bddf37166c590;p=freeside.git diff --git a/rt/lib/RT/ACL.pm b/rt/lib/RT/ACL.pm index 0662b3955..83423ad9e 100755 --- a/rt/lib/RT/ACL.pm +++ b/rt/lib/RT/ACL.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -222,34 +222,21 @@ sub LimitToPrincipal { -sub Next { +sub AddRecord { my $self = shift; + my ($record) = @_; - my $ACE = $self->SUPER::Next(); # Short-circuit having to load up the ->Object - return $ACE - if $self->CurrentUser->PrincipalObj->Id == RT->SystemUser->Id; - if ( ( defined($ACE) ) and ( ref($ACE) ) ) { - - if ( $self->CurrentUser->HasRight( Right => 'ShowACL', - Object => $ACE->Object ) - or $self->CurrentUser->HasRight( Right => 'ModifyACL', - Object => $ACE->Object ) - ) { - return ($ACE); - } - - #If the user doesn't have the right to show this ACE - else { - return ( $self->Next() ); - } - } + return $self->SUPER::AddRecord( $record ) + if $record->CurrentUser->PrincipalObj->Id == RT->SystemUser->Id; - #if there never was any ACE - else { - return (undef); - } + my $obj = $record->Object; + return unless $self->CurrentUser->HasRight( Right => 'ShowACL', + Object => $obj ) + or $self->CurrentUser->HasRight( Right => 'ModifyACL', + Object => $obj ); + return $self->SUPER::AddRecord( $record ); }