- Модуль: socialnetwork
- Путь к файлу: ~/bitrix/modules/socialnetwork/lib/item/workgroup/accessmanager.php
- Класс: BitrixSocialnetworkItemWorkgroupAccessManager
- Вызов: AccessManager::canLeave
public function canLeave(): bool
{
$this->checkGroupEntityFields([
'ID',
'PROJECT',
'SCRUM_MASTER_ID',
]);
$this->checkRelationEntityFields($this->currentUserRelation, [
'GROUP_ID',
'USER_ID',
'ROLE',
'AUTO_MEMBER',
]);
if (
!$this->currentUserRelation
|| !$this->checkRelationGroupId($this->currentUserRelation)
)
{
return false;
}
if (!in_array($this->currentUserRelation->get('ROLE'), [
UserToGroupTable::ROLE_USER ,
UserToGroupTable::ROLE_MODERATOR
], true))
{
return false;
}
if ($this->currentUserRelation->get('AUTO_MEMBER'))
{
return false;
}
if ($this->checkScrumMaster($this->currentUserRelation))
{
return false;
}
return true;
}