Skip to content

Commit

Permalink
ACL check for articles modal view
Browse files Browse the repository at this point in the history
  • Loading branch information
LivioCavallo committed Sep 3, 2017
1 parent c855a9b commit 86b11f1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions components/com_content/content.php
Expand Up @@ -13,6 +13,19 @@
JLoader::register('ContentHelperQuery', JPATH_SITE . '/components/com_content/helpers/query.php');
JLoader::register('ContentHelperAssociation', JPATH_SITE . '/components/com_content/helpers/association.php');

$input = JFactory::getApplication()->input;
$user = JFactory::getUser();

if ($input->get('view') === 'articles' && $input->get('layout') === 'modal')
{
if (!$user->authorise('core.create', 'com_content') || count($user->getAuthorisedCategories('com_content', 'core.create')) == 0 )
{
JFactory::getApplication()->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'warning');

return;
}
}

$controller = JControllerLegacy::getInstance('Content');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();

0 comments on commit 86b11f1

Please sign in to comment.