X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FACL.pm;h=83423ad9e295f56111dc2555e07fa55d3f1b22c1;hp=d7c9ef2a8144ae0e719ae6091051610e2ac56ef3;hb=919e930aa9279b3c5cd12b593889cd6de79d67bf;hpb=43a06151e47d2c59b833cbd8c26d97865ee850b6 diff --git a/rt/lib/RT/ACL.pm b/rt/lib/RT/ACL.pm index d7c9ef2a8..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-2012 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -182,6 +182,9 @@ sub LimitToPrincipal { ALIAS2 => $cgm, FIELD2 => 'GroupId' ); + $self->Limit( ALIAS => $cgm, + FIELD => 'Disabled', + VALUE => 0 ); $self->Limit( ALIAS => $cgm, FIELD => 'MemberId', OPERATOR => '=', @@ -219,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 ); }