diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-08-07 22:01:31 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-08-07 22:01:31 -0700 |
commit | 0c76afbb717e1716e6126bc4a120b8d9471614a0 (patch) | |
tree | 9a398e455a7767372588077470685d25ef8d82b3 /rt/lib/RT/Articles.pm | |
parent | 7beec7068e00be5ae1b2599fdf2b494bc19e31d0 (diff) | |
parent | 3e2c2ad8aff1bd361ca07495b2255538c8231079 (diff) |
Merge branch 'FREESIDE_3_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_3_BRANCH
Diffstat (limited to 'rt/lib/RT/Articles.pm')
-rw-r--r-- | rt/lib/RT/Articles.pm | 30 |
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'} |