X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FArticles%2FElements%2FNewestArticles;h=066656f8af4ea95cb7e09a492eeea68c1a8880c6;hb=de9d037528895f7151a9aead6724ce2df95f9586;hp=e73dbbd40cf5fafb617d6211442745e16951c158;hpb=7322f2afedcc2f427e997d1535a503613a83f088;p=freeside.git diff --git a/rt/share/html/Articles/Elements/NewestArticles b/rt/share/html/Articles/Elements/NewestArticles index e73dbbd40..066656f8a 100644 --- a/rt/share/html/Articles/Elements/NewestArticles +++ b/rt/share/html/Articles/Elements/NewestArticles @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -71,9 +71,18 @@ <%INIT> my $rows = 10; my $i; + +my $Classes = RT::Classes->new($session{'CurrentUser'}); +$Classes->LimitToEnabled; +my @classes; +while (my $Class = $Classes->Next) { + push @classes, $Class->id if $Class->CurrentUserHasRight('ShowArticle'); +} + my $MyArticles; $MyArticles = RT::Articles->new($session{'CurrentUser'}); -$MyArticles->UnLimit; +$MyArticles->Limit(FIELD => 'Class', OPERATOR => 'IN', VALUE => \@classes) + if @classes; $MyArticles->RowsPerPage($rows); $MyArticles->OrderBy(FIELD => 'LastUpdated', ORDER => 'DESC');