Skip to content

Commit

Permalink
[categories] - respect user access level
Browse files Browse the repository at this point in the history
[categories] - respect user access level
  • Loading branch information
alikon committed Nov 17, 2016
1 parent 3d9d2ce commit 08fc542
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions administrator/components/com_content/models/featured.php
Expand Up @@ -74,6 +74,7 @@ protected function getListQuery()
// Create a new query object.
$db = $this->getDbo();
$query = $db->getQuery(true);
$user = JFactory::getUser();

// Select the required fields from the table.
$query->select(
Expand Down Expand Up @@ -123,6 +124,13 @@ protected function getListQuery()
$query->where('a.access = ' . (int) $access);
}

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

// Filter by published state
$published = $this->getState('filter.published');

Expand Down

0 comments on commit 08fc542

Please sign in to comment.