CoreFiles by mySites.guru
Dispatcher.php43 lines, 1,089 bytes, from Joomla_5.4.12-Stable-Full_Package.zip
Raw History Compare with 5.4.11
md5
8872b088fce84d6413592e42230c8bfd
sha1
0a6e24f93ff44937592d9f6dca3bfe75c3fd893b
sha256
65a576840e3bb7bfa335cb0e233c31e78e2e5fc2d186f4be047bda25a205e678
<?php

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

namespace Joomla\Component\Privacy\Api\Dispatcher;

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

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

/**
 * Component dispatcher class for com_privacy
 *
 * @since  5.4.11
 */
class Dispatcher extends ApiDispatcher
{
    /**
     * Method to check component access permission
     *
     * @return  void
     *
     * @throws  NotAllowed
     */
    protected function checkAccess(): void
    {
        // Privacy requests contain personal data, only users with the admin permission may use them in the API
        if ($this->app->getIdentity()->authorise('core.admin', $this->option)) {
            return;
        }

        throw new NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR'), 403);
    }
}

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