CoreFiles by mySites.guru
Dispatcher.php41 lines, 1,081 bytes, from Joomla_4.0.0-beta5-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta4
md5
d6ed800575151720116e513be864e762
sha1
b76d98d6b16ff24a722d5f20aec1d45065a143e1
sha256
d97ef62fc189582ea1e9920f69e2c20ed06c79ae4098d1e887731abd8ea40611
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_workflow
 *
 * @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\Workflow\Administrator\Dispatcher;

\defined('_JEXEC') or die;

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

/**
 * ComponentDispatcher class for com_workflow
 *
 * @since  4.0.0
 */
class Dispatcher extends ComponentDispatcher
{
	/**
	 * Workflows have to check for extension permission
	 *
	 * @return  void
	 */
	protected function checkAccess()
	{
		$extension = $this->getApplication()->input->getCmd('extension');

		$parts = explode('.', $extension);

		// Check the user has permission to access this component if in the backend
		if ($this->app->isClient('administrator') && !$this->app->getIdentity()->authorise('core.manage.workflow', $parts[0]))
		{
			throw new NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR'), 403);
		}
	}
}

The same content is in 4 releases, Joomla 4.0.0-beta2 to 4.0.0-beta5. See them all, or every version of this file.