CoreFiles by mySites.guru
Dispatcher.php43 lines, 1,088 bytes, from Joomla_6.2.1-Stable-Full_Package.zip
Raw History Compare with 6.2.0
md5
bbddb7b42f52fe35079bc1c3c4afacb5
sha1
2f86d0ea04960a46e5ac18b5e0d86e5551aeb000
sha256
08d92f9e43998e6a63c70220c3c6e4d2fa462ce29c8b6b1fd338dffd006d59e2
<?php

/**
 * @package     Joomla.Api
 * @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\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.