CoreFiles by mySites.guru
Dispatcher.php39 lines, 1,132 bytes, from Joomla_5.2.2-Stable-Full_Package.zip
Raw History Compare with 5.2.1
md5
5e296aedc8a9d7d54e5d17b10846d560
sha1
295649ab233135651c95718f0fe7008695fffc3c
sha256
4b3510f8ee0209ae810d265c6b138b7f705fe44980e0cabb2287d23b70a52290
<?php

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

namespace Joomla\Component\Joomlaupdate\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_joomlaupdate
 *
 * @since  4.0.0
 */
class Dispatcher extends ComponentDispatcher
{
    /**
     * Joomla Update is checked for global core.admin rights - not the usual core.manage for the component
     *
     * @return  void
     */
    protected function checkAccess()
    {
        // Check the user has permission to access this component if in the backend
        if ($this->app->isClient('administrator') && !$this->app->getIdentity()->authorise('core.admin')) {
            throw new NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR'), 403);
        }
    }
}

The same content is in 197 releases, Joomla 4.3.3-rc1 to 6.3.0-alpha1. See them all, or every version of this file.