CoreFiles by mySites.guru
Dispatcher.php53 lines, 1,269 bytes, from Joomla_4.0.0-beta5-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta4
md5
44141d2069c3e656034d6ced64c7b454
sha1
050d0e18513e12efe9818cb116c78a640837a14f
sha256
a6a617636a89d94244ca805322905bda656b26034220cb7e531d287bdf138733
<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Config\Site\Dispatcher;

\defined('_JEXEC') or die;

use Joomla\CMS\Access\Exception\NotAllowed;
use Joomla\CMS\Dispatcher\ComponentDispatcher;

/**
 * ComponentDispatcher class for com_config
 *
 * @since  4.0.0
 */
class Dispatcher extends ComponentDispatcher
{
	/**
	 * Method to check component access permission
	 *
	 * @since   4.0.0
	 *
	 * @return  void
	 *
	 * @throws  Exception|NotAllowed
	 */
	protected function checkAccess()
	{
		parent::checkAccess();

		$task = $this->input->getCmd('task', 'display');
		$view = $this->input->get('view');
		$user = $this->app->getIdentity();

		if (substr($task, 0, 8) === 'modules.' || $view === 'modules')
		{
			if (!$user->authorise('module.edit.frontend', 'com_modules.module.' . $this->input->get('id')))
			{
				throw new NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR'), 403);
			}
		}
		elseif (!$user->authorise('core.admin'))
		{
			throw new NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR'), 403);
		}
	}
}

No other release has this exact content. See every version of this file.