summaryrefslogtreecommitdiff
path: root/rt/lib/RT/Classes.pm
diff options
context:
space:
mode:
Diffstat (limited to 'rt/lib/RT/Classes.pm')
-rw-r--r--rt/lib/RT/Classes.pm29
1 files changed, 8 insertions, 21 deletions
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
# <sales@bestpractical.com>
#
# (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 {