summaryrefslogtreecommitdiff
path: root/rt/lib/RT/Articles.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-06-12 15:19:00 -0700
committerIvan Kohler <ivan@freeside.biz>2015-07-09 17:56:53 -0700
commit31f3763747b82764bb019cfab5b2a2945fc9a99d (patch)
tree36715bb96a8f9c02eb41f5fdab4a0b181b2d2e3a /rt/lib/RT/Articles.pm
parent5e9677cbad2051ea452b389fa03bddf37166c590 (diff)
rt 4.0.23
Diffstat (limited to 'rt/lib/RT/Articles.pm')
-rw-r--r--rt/lib/RT/Articles.pm30
1 files changed, 8 insertions, 22 deletions
diff --git a/rt/lib/RT/Articles.pm b/rt/lib/RT/Articles.pm
index 9bee84472..680023296 100644
--- a/rt/lib/RT/Articles.pm
+++ b/rt/lib/RT/Articles.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,33 +64,19 @@ sub _Init {
return $self->SUPER::_Init( @_ );
}
-=head2 Next
+=head2 AddRecord
-Returns the next article that this user can see.
+Overrides the collection to ensure that only Articles 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('ShowArticle') ) {
- return ($Object);
- }
-
- #If the user doesn't have the right to show this Object
- else {
- return ( $self->Next() );
- }
- }
-
- #if there never was any queue
- else {
- return (undef);
- }
-
+ return unless $record->CurrentUserHasRight('ShowArticle');
+ return $self->SUPER::AddRecord( $record );
}
=head2 Limit { FIELD => undef, OPERATOR => '=', VALUE => 'undef'}