CoreFiles by mySites.guru
Dispatcher.php43 lines, 1,214 bytes, from Joomla_5.2.2-Stable-Full_Package.zip
Raw History Compare with 5.2.1
md5
69ea4ae9fae05b1103d5d6d93357b46e
sha1
323a37abcd703ce5f224eefd9c9f636e77e272ef
sha256
9d936c2bda2e2aeb229e11a36f9000e9899164727103427db735204cb7ce8b04
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_workflow
 *
 * @copyright   (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Workflow\Administrator\Dispatcher;

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

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * 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()->getInput()->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 179 releases, Joomla 4.3.0-alpha1 to 6.1.0-alpha3. See them all, or every version of this file.