• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/classes/general/iblock_rights.php
  • Класс: CIBlockRightsStorage
  • Вызов: CIBlockRightsStorage::deleteRightsByOwner
static function deleteRightsByOwner(string $ownerId): void
{
	$ownerId = trim($ownerId);
	if ($ownerId === '')
	{
		return;
	}
	$conn = MainApplication::getConnection();
	$conn->queryExecute("
		delete r2 from b_iblock_right r
		inner join b_iblock_element_right r2 on r2.RIGHT_ID = r.ID and r2.IBLOCK_ID = r.IBLOCK_ID
		where r.GROUP_CODE = '".$ownerId."'
	");
	$conn->queryExecute("
		delete r2 from b_iblock_right r
		inner join b_iblock_section_right r2 on r2.RIGHT_ID = r.ID and r2.IBLOCK_ID = r.IBLOCK_ID
		where r.GROUP_CODE = '".$ownerId."'
	");
	$conn->queryExecute("
		delete from b_iblock_right where GROUP_CODE = '".$ownerId."'
	");
}