X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FClasses.pm;fp=rt%2Flib%2FRT%2FClasses.pm;h=0175b2ffc7e220aab12a06859f00d7b880cec7ee;hb=919e930aa9279b3c5cd12b593889cd6de79d67bf;hp=6b50d5dcef864323ec21925aae546c2eaca06f0d;hpb=f303acf0bfdbd5debea67d391e111ae4ee62cb78;p=freeside.git diff --git a/rt/lib/RT/Classes.pm b/rt/lib/RT/Classes.pm index 6b50d5dce..0175b2ffc 100644 --- a/rt/lib/RT/Classes.pm +++ b/rt/lib/RT/Classes.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) @@ -64,32 +64,19 @@ sub Table {'Classes'} return ($self->SUPER::_Init(@_)); } -=head2 Next +=head2 AddRecord -Returns the next Object that this user can see. +Overrides the collection to ensure that only Classes the user can +see are returned. =cut -sub Next { +sub AddRecord { my $self = shift; + my ($record) = @_; - - my $Object = $self->SUPER::Next(); - if ((defined($Object)) and (ref($Object))) { - if ( $Object->CurrentUserHasRight('SeeClass') ) { - return($Object); - } - - #If the user doesn't have the right to show this Object - else { - return($self->Next()); - } - } - #if there never was any Object - else { - return(undef); - } - + return unless $record->CurrentUserHasRight('SeeClass'); + return $self->SUPER::AddRecord( $record ); } sub ColumnMapClassName {