• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/item/workgroup/accessmanager.php
  • Класс: BitrixSocialnetworkItemWorkgroupAccessManager
  • Вызов: AccessManager::canDeleteOutgoingRequest
public function canDeleteOutgoingRequest(): bool
{
	$this->checkGroupEntityFields([
		'ID',
		'CLOSED',
		'PROJECT',
		'SCRUM_MASTER_ID',
		'INITIATE_PERMS',
	]);
	$this->checkRelationEntityFields($this->currentUserRelation, [
		'GROUP_ID',
		'USER_ID',
		'ROLE',
	]);
	$this->checkRelationEntityFields($this->targetUserRelation, [
		'GROUP_ID',
		'ROLE',
		'INITIATED_BY_TYPE',
		'INITIATED_BY_USER_ID',
	]);

	if (
		!$this->isCurrentUserModuleAdmin
		&& !$this->checkRelationGroupId($this->currentUserRelation)
	)
	{
		return false;
	}

	if (
		!$this->targetUserRelation
		|| !$this->checkRelationGroupId($this->targetUserRelation)
	)
	{
		return false;
	}

	if (
		$this->targetUserRelation->get('ROLE') !== UserToGroupTable::ROLE_REQUEST
		|| $this->targetUserRelation->get('INITIATED_BY_TYPE') !== UserToGroupTable::INITIATED_BY_GROUP
	)
	{
		return false;
	}

	if (
		!$this->canCurrentUserInitiate()
		&& (int)$this->targetUserRelation->get('INITIATED_BY_USER_ID') !== $this->currentUserId
	)
	{
		return false;
	}

	return true;
}