Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/catalog/lib/grid/access/ |
Upload File : |
<?php namespace Bitrix\Catalog\Grid\Access; use Bitrix\Catalog\Access\AccessController; use Bitrix\Catalog\Access\ActionDictionary; use Bitrix\Iblock\Grid\Access\IblockRightsChecker; use Bitrix\Main\Loader; Loader::requireModule('iblock'); class ProductRightsChecker extends IblockRightsChecker { private AccessController $controller; public function __construct(int $iblockId, ?AccessController $controller = null) { parent::__construct($iblockId); $this->controller = $controller ?? AccessController::getCurrent(); } public function canEditPrices(): bool { return $this->controller->check(ActionDictionary::ACTION_PRICE_EDIT); } #region override public function canAddElement(int $elementId): bool { return $this->controller->check(ActionDictionary::ACTION_PRODUCT_ADD); } public function canEditElement(int $elementId): bool { return $this->controller->check(ActionDictionary::ACTION_PRODUCT_EDIT); } public function canEditElements(): bool { return $this->controller->check(ActionDictionary::ACTION_PRODUCT_EDIT); } public function canEditSection(int $sectionId): bool { return $this->controller->check(ActionDictionary::ACTION_PRODUCT_EDIT); } public function canDeleteElement(int $elementId): bool { return $this->controller->check(ActionDictionary::ACTION_PRODUCT_DELETE); } public function canDeleteElements(): bool { return $this->controller->check(ActionDictionary::ACTION_PRODUCT_DELETE); } public function canDeleteSection(int $sectionId): bool { return $this->controller->check(ActionDictionary::ACTION_PRODUCT_DELETE); } public function canBindElementToSection(int $sectionId): bool { return $this->controller->check(ActionDictionary::ACTION_PRODUCT_EDIT); } public function canBindSectionToSection(int $sectionId): bool { return $this->controller->check(ActionDictionary::ACTION_PRODUCT_EDIT); } #endregion override }