Skip to content

Commit

Permalink
Merge branch '5.0/self-service-dashboard-no-classes' into 5.0-trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnavy committed Jul 10, 2023
2 parents 87efbf0 + 208bc3a commit e33b9c6
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions share/html/Elements/SelfServiceShowArticles
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,20 @@ if ( $session{'CurrentUser'}->HasRight( Right => $right, Object => $RT::System )
else {
my $classes = RT::Classes->new( $session{'CurrentUser'} );
$classes->UnLimit;
$articles->Limit(
FIELD => 'Class',
VALUE => [ map { $_->Id } grep { $_->CurrentUserHasRight($right) } @{ $classes->ItemsArrayRef } ],
OPERATOR => 'IN',
);
$classes->LimitToEnabled;

my @classes;
while ( my $class = $classes->Next ) {
push @classes, $class->id if $class->CurrentUserHasRight($right);
}

if ( @classes ) {
$articles->Limit(
FIELD => 'Class',
VALUE => \@classes,
OPERATOR => 'IN',
);
}
}
$articles->OrderBy(FIELD => $orderby_field, ORDER => $sortorder);
$articles->RowsPerPage($rows);
Expand Down

0 comments on commit e33b9c6

Please sign in to comment.