summaryrefslogtreecommitdiff
path: root/rt/lib/RT/ACL.pm
diff options
context:
space:
mode:
Diffstat (limited to 'rt/lib/RT/ACL.pm')
-rwxr-xr-xrt/lib/RT/ACL.pm35
1 files changed, 11 insertions, 24 deletions
diff --git a/rt/lib/RT/ACL.pm b/rt/lib/RT/ACL.pm
index 0662b39..83423ad 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
# <sales@bestpractical.com>
#
# (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 );
}