/
githubmirror
/
joomla-cms
Обзор
Документация
Войти
/
githubmirror
/
joomla-cms
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
5.4-dev
components/com_config/src/Dispatcher/Dispatcher.php
52 строки
1 KB
Tuan Pham Ngoc
[5.3] Use str_starts_with function for components (#44868)
16 фев 2025, 03:14
Не верифицирован
16 фев 2025, 03:14
30f8c9d
Код
Авторство
О чём код?
<?php /** * @package Joomla.Site * @subpackage com_config * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Config\Site\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_config * * @since 4.0.0 */ class Dispatcher extends ComponentDispatcher { /** * Method to check component access permission * * @since 4.0.0 * * @return void * * @throws \Exception|NotAllowed */ protected function checkAccess() { parent::checkAccess(); $task = $this->input->getCmd('task', 'display'); $view = $this->input->get('view'); $user = $this->app->getIdentity(); if (str_starts_with($task, 'modules.') || $view === 'modules') { if (!$user->authorise('module.edit.frontend', 'com_modules.module.' . $this->input->get('id'))) { throw new NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR'), 403); } } elseif (!$user->authorise('core.admin')) { throw new NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR'), 403); } } }