CoreFiles by mySites.guru
Dispatcher.php39 lines, 1,077 bytes, from Joomla_5.2.3-Stable-Full_Package.zip
Raw History Compare with 5.2.2
md5
b670058796b33fdf806b463da2f4eb75
sha1
fa5f0f750d1b42364e377544bad889f5e9d7b0ae
sha256
4ba1443ec9aefdd8a9ef82326c4bc4d8dc99ec97f2a5f880c0a29bfe2b62e3d1
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_privacy
 *
 * @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\Privacy\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

/**
 * Component dispatcher class for com_privacy
 *
 * @since  4.0.0
 */
class Dispatcher extends ComponentDispatcher
{
    /**
     * Method to check component access permission
     *
     * @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', $this->option)) {
            throw new NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR'), 403);
        }
    }
}

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