49 if (!static::$instanceCurrentUser)
51 static::$instanceCurrentUser =
new static();
54 return static::$instanceCurrentUser;
63 public static function get(
$id)
65 if (!static::$instance || static::$instance->
getId() !=
$id)
67 static::$instance =
new static(
$id);
70 return static::$instance;
90 if ($this->isCurrent())
105 if ($this->isCurrent())
110 return in_array(1, UserTable::getUserGroupIds($this->
id));
120 return $this->
getAccess()->canViewAnything();
146 if (!$this->isModuleAccessibleOnPortal())
151 if ($this->isBroadAccess())
161 if (is_object(
$GLOBALS[
'APPLICATION']) &&
$GLOBALS[
'APPLICATION']->getGroupRight(
'sender') !==
"D")
169 private function isBroadAccess()
181 return !Role\Manager::canUse();
184 private function isModuleAccessibleOnPortal()
186 if (!Integration\Bitrix24\Service::isCloud())
191 return Option::get(
'sender',
'~is_accessible_on_portal',
'Y') ===
'Y';
201 if (!$this->isModuleAccessibleOnPortal())
206 if ($this->isBroadAccess())
216 if (is_object(
$GLOBALS[
'APPLICATION']) &&
$GLOBALS[
'APPLICATION']->getGroupRight(
'sender') ===
"W")
236 return $this->
getObject()->canDoOperation(
'bitrix24_config', $this->
id);
241 if(!$this->isConfigured())
246 if(array_key_exists($this->
getId(), static::$cache))
248 return static::$cache[$this->
getId()];
258 private function isConfigured()
260 return Loader::includeModule(
'extranet') && $this->getExtranetSiteID();
263 private function getExtranetSiteID()
265 $extranet_site_id = \COption::GetOptionString(
"extranet",
"extranet_site");
267 ($extranet_site_id !==
'')
268 && \CSite::GetArrayByID($extranet_site_id)
271 return $extranet_site_id;
304 return $this->
getObject()->canDoOperation(
'edit_php', $this->
id);
319 return $this->
getObject()->canDoOperation(
'lpa_template_edit', $this->
id);
334 if ($this->isCurrent())
341 $this->
object = new \CUser();
347 private function isCurrent(): bool
349 return !$this->
id || ($this?->id == CurrentUser::get()->getId());
$GLOBALS['____1690880296']