• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Message/Update/UpdateService.php
  • Класс: BitrixImV2MessageUpdateUpdateService
  • Вызов: UpdateService::canUpdate
public function canUpdate(): bool
{
	global $USER;
	if ($USER->IsAdmin())
	{
		return true;
	}

	$chat = $this->message->getChat();
	$userId = $this->getContext()->getUserId();

	if (!$chat->hasAccess($userId))
	{
		return false;
	}

	if ($this->message->getAuthorId() === $userId)
	{
		return true;
	}

	return false;
}