Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
productrightschecker.php
1<?php
2
4
9
10Loader::requireModule('iblock');
11
13{
14 private AccessController $controller;
15
16 public function __construct(int $iblockId, ?AccessController $controller = null)
17 {
18 parent::__construct($iblockId);
19 $this->controller = $controller ?? AccessController::getCurrent();
20 }
21
22 public function canEditPrices(): bool
23 {
24 return $this->controller->check(ActionDictionary::ACTION_PRICE_EDIT);
25 }
26
27 #region override
28
29 public function canAddElement(int $elementId): bool
30 {
31 return $this->controller->check(ActionDictionary::ACTION_PRODUCT_ADD);
32 }
33
34 public function canEditElement(int $elementId): bool
35 {
36 return $this->controller->check(ActionDictionary::ACTION_PRODUCT_EDIT);
37 }
38
39 public function canEditElements(): bool
40 {
41 return $this->controller->check(ActionDictionary::ACTION_PRODUCT_EDIT);
42 }
43
44 public function canEditSection(int $sectionId): bool
45 {
46 return $this->controller->check(ActionDictionary::ACTION_PRODUCT_EDIT);
47 }
48
49 public function canDeleteElement(int $elementId): bool
50 {
51 return $this->controller->check(ActionDictionary::ACTION_PRODUCT_DELETE);
52 }
53
54 public function canDeleteElements(): bool
55 {
56 return $this->controller->check(ActionDictionary::ACTION_PRODUCT_DELETE);
57 }
58
59 public function canDeleteSection(int $sectionId): bool
60 {
61 return $this->controller->check(ActionDictionary::ACTION_PRODUCT_DELETE);
62 }
63
64 public function canBindElementToSection(int $sectionId): bool
65 {
66 return $this->controller->check(ActionDictionary::ACTION_PRODUCT_EDIT);
67 }
68
69 public function canBindSectionToSection(int $sectionId): bool
70 {
71 return $this->controller->check(ActionDictionary::ACTION_PRODUCT_EDIT);
72 }
73
74 #endregion override
75}
__construct(int $iblockId, ?AccessController $controller=null)