1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
rightparam.php
См. документацию.
1<?php
2
3namespace Bitrix\Lists\Security;
4
5use Bitrix\Lists\Entity\Utils;
6use Bitrix\Lists\Service\Param;
7use Bitrix\Main\Loader;
8use Bitrix\Main\Config\Option;
9
11{
12 private $user = null;
13 private $iblockTypeId = '';
14 private $iblockId = false;
15 private $socnetGroupId = 0;
16 private $entityId = 0;
17
18 private ?int $sectionId = null;
19
20 public function __construct(Param $param)
21 {
22 $params = $param->getParams();
23
24 $this->setIblockTypeId($params["IBLOCK_TYPE_ID"]);
25 $this->setIblockId(Utils::getIblockId($params));
26 $this->setSocnetGroupId($params["SOCNET_GROUP_ID"] ?? 0);
27 }
28
32 public function getUser()
33 {
34 return $this->user;
35 }
36
40 public function setUser(\CUser $user)
41 {
42 $this->user = $user;
43 }
44
48 public function getIblockTypeId()
49 {
51 }
52
56 public function setIblockTypeId($iblockTypeId)
57 {
58 $this->iblockTypeId = (is_string($iblockTypeId) ? $iblockTypeId : '');
59 }
60
64 public function getIblockId()
65 {
66 return $this->iblockId;
67 }
68
72 public function setIblockId($iblockId)
73 {
74 $this->iblockId = ($iblockId ? (int)$iblockId : false);
75 }
76
80 public function getSocnetGroupId()
81 {
82 return $this->socnetGroupId;
83 }
84
88 public function setSocnetGroupId($socnetGroupId)
89 {
90 $this->socnetGroupId = (int)$socnetGroupId;
91 }
92
96 public function getEntityId()
97 {
98 return $this->entityId;
99 }
100
104 public function setEntityId($entityId)
105 {
106 $this->entityId = (int)$entityId;
107 }
108
109 /***
110 * @return int|null
111 */
112 public function getSectionId(): ?int
113 {
114 return $this->sectionId;
115 }
116
117 /***
118 * @param int $sectionId
119 */
120 public function setSectionId(int $sectionId)
121 {
122 if ($sectionId >= 0)
123 {
124 $this->sectionId = $sectionId;
125 }
126 }
127
137 {
138 $socnetGroupId = intval($this->socnetGroupId);
139 if ($socnetGroupId && Loader::includeModule("socialnetwork"))
140 {
141 $socnetGroup = \CSocNetGroup::getByID($socnetGroupId);
142 if (
143 is_array($socnetGroup) &&
144 $socnetGroup["CLOSED"] == "Y" &&
145 !\CSocNetUser::isCurrentUserModuleAdmin() &&
146 ($socnetGroup["OWNER_ID"] != $this->getUser()->getID() ||
147 Option::get("socialnetwork", "work_with_closed_groups", "N") != "Y")
148 )
149 {
150 return true;
151 }
152 }
153 return false;
154 }
155}
setIblockId($iblockId)
Определения rightparam.php:72
setEntityId($entityId)
Определения rightparam.php:104
setSectionId(int $sectionId)
Определения rightparam.php:120
setSocnetGroupId($socnetGroupId)
Определения rightparam.php:88
setUser(\CUser $user)
Определения rightparam.php:40
__construct(Param $param)
Определения rightparam.php:20
setIblockTypeId($iblockTypeId)
Определения rightparam.php:56
getParams()
Определения param.php:70
$iblockTypeId
Определения group_lists.php:25
$iblockId
Определения iblock_catalog_edit.php:30
$user
Определения mysql_to_pgsql.php:33
$entityId
Определения payment.php:4
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799