CoreFiles by mySites.guru
Dispatcher.php43 lines, 1,089 bytes, from Joomla_5.4.11-Stable-Full_Package.zip
Raw History Compare with 5.4.10
md5
0ff291ed291692fa7234b9a9370694c7
sha1
a098ed9ccacf037f9324e989aca0ec339b329191
sha256
ea7d8771391fb4a4fe6954e2ce1bd38d2058d024113fc8d5cc5f7d0c8f5efe47
<?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  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.