From 919e930aa9279b3c5cd12b593889cd6de79d67bf Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Fri, 12 Jun 2015 15:19:00 -0700 Subject: rt 4.0.23 --- rt/lib/RT/Classes.pm | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'rt/lib/RT/Classes.pm') 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 { -- cgit v1.2.1