CoreFiles by mySites.guru
Dispatcher.php43 lines, 1,068 bytes, from Joomla_4.3.2-Stable-Full_Package.zip
Raw History Compare with 4.3.1
md5
699cb017ee084b4379dbf49ea6031356
sha1
852674f30a0cb32374cd56e72b614fff99ca3997
sha256
4ac7178ee47462b6e4a5ecb86d2c6e6e83321efc9a419bb34533ddf1fdb80643
<?php

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

namespace Joomla\Component\Actionlogs\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

/**
 * ComponentDispatcher class for com_admin
 *
 * @since  4.2.7
 */
class Dispatcher extends ComponentDispatcher
{
    /**
     * com_admin does not require check permission, so we override checkAccess method and have it empty
     *
     * @return  void
     *
     * @since 4.2.7
     */
    protected function checkAccess()
    {
        $user = $this->app->getIdentity();

        // Access check
        if (!$user->authorise('core.admin')) {
            throw new NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR'), 403);
        }
    }
}

The same content is in 16 releases, Joomla 4.2.9-rc1 to 5.0.0-alpha1. See them all, or every version of this file.