[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Site 5 * @subpackage com_fields 6 * 7 * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> 8 * @license GNU General Public License version 2 or later; see LICENSE.txt 9 */ 10 11 namespace Joomla\Component\Fields\Site\Dispatcher; 12 13 use Joomla\CMS\Access\Exception\NotAllowed; 14 use Joomla\CMS\Dispatcher\ComponentDispatcher; 15 use Joomla\Component\Fields\Administrator\Helper\FieldsHelper; 16 17 // phpcs:disable PSR1.Files.SideEffects 18 \defined('_JEXEC') or die; 19 // phpcs:enable PSR1.Files.SideEffects 20 21 /** 22 * ComponentDispatcher class for com_fields 23 * 24 * @since 4.0.0 25 */ 26 class Dispatcher extends ComponentDispatcher 27 { 28 /** 29 * Method to check component access permission 30 * 31 * @return void 32 * 33 * @since 4.0.0 34 */ 35 protected function checkAccess() 36 { 37 parent::checkAccess(); 38 39 if ($this->input->get('view') !== 'fields' || $this->input->get('layout') !== 'modal') { 40 return; 41 } 42 43 $context = $this->app->getUserStateFromRequest('com_fields.fields.context', 'context', 'com_content.article', 'CMD'); 44 $parts = FieldsHelper::extract($context); 45 46 if ( 47 !$this->app->getIdentity()->authorise('core.create', $parts[0]) 48 || !$this->app->getIdentity()->authorise('core.edit', $parts[0]) 49 ) { 50 throw new NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR')); 51 } 52 } 53 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |