CoreFiles by mySites.guru
Dispatcher.php43 lines, 1,088 bytes, from Joomla_6.2.2-Stable-Full_Package.zip
Raw History Compare with 6.2.1
md5
32a64ffe365524edce66b26b5cd3b749
sha1
6dd0a57c6b4e58ef340cbae6a60bc6088f4701db
sha256
374d9afa5704e24692f6430eed3fbbd5d749616a6d4529d9f3daca8e84023f3a
<?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  6.2.1
 */
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.