X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FScrips.pm;fp=rt%2Flib%2FRT%2FScrips.pm;h=4649885f70e41a7a293baf06018740dba5affe64;hb=31f3763747b82764bb019cfab5b2a2945fc9a99d;hp=de9d1eae90e4db0c485bda52b977443001842f90;hpb=5e9677cbad2051ea452b389fa03bddf37166c590;p=freeside.git diff --git a/rt/lib/RT/Scrips.pm b/rt/lib/RT/Scrips.pm index de9d1eae9..4649885f7 100755 --- a/rt/lib/RT/Scrips.pm +++ b/rt/lib/RT/Scrips.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) @@ -114,35 +114,19 @@ sub LimitToGlobal { } -# {{{ sub Next +=head2 AddRecord -=head2 Next - -Returns the next scrip that this user can see. +Overrides the collection to ensure that only scrips the user can see are +returned. =cut - -sub Next { + +sub AddRecord { my $self = shift; - - - my $Scrip = $self->SUPER::Next(); - if ((defined($Scrip)) and (ref($Scrip))) { - - if ($Scrip->CurrentUserHasRight('ShowScrips')) { - return($Scrip); - } - - #If the user doesn't have the right to show this scrip - else { - return($self->Next()); - } - } - #if there never was any scrip - else { - return(undef); - } - + my ($record) = @_; + + return unless $record->CurrentUserHasRight('ShowScrips'); + return $self->SUPER::AddRecord( $record ); } =head2 Apply