X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FACL.pm;h=83423ad9e295f56111dc2555e07fa55d3f1b22c1;hp=0662b3955b0c55822902f9b2b6a59ecae96cebf5;hb=919e930aa9279b3c5cd12b593889cd6de79d67bf;hpb=45d35d5739d05e602bc317739485693e0e9ff0b5 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 ); }