Skip to content

Commit

Permalink
[com_content] Featured articles access filter
Browse files Browse the repository at this point in the history
  • Loading branch information
SharkyKZ committed Jul 18, 2018
1 parent 7279924 commit 6b203ed
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion administrator/components/com_content/models/featured.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,24 @@ protected function getListQuery()
}

// Filter by access level.
if ($access = $this->getState('filter.access'))
$access = $this->getState('filter.access');

if (is_numeric($access))
{
$query->where('a.access = ' . (int) $access);
}
elseif (is_array($access))
{
$access = ArrayHelper::toInteger($access);
$access = implode(',', $access);
$query->where('a.access IN (' . $access . ')');
}

// Filter by access level on categories.
if (!$user->authorise('core.admin'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
$query->where('c.access IN (' . $groups . ')');
}

Expand Down

0 comments on commit 6b203ed

Please sign in to comment.