• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/rightsmanager.php
  • Класс: BitrixDiskRightsManager
  • Вызов: RightsManager::insertRightsInternal
private function insertRightsInternal(BaseObject $object, array $rights)
{
	$rightsToInsert = array();
	foreach ($rights as $right)
	{
		if (isset($right['NEGATIVE']))
		{
			$right['NEGATIVE'] = (int)$right['NEGATIVE'];
		}
		else
		{
			$right['NEGATIVE'] = 0; //default value @see BitrixDiskInternalsRightTable
		}

		if (!isset($right['DOMAIN']))
		{
			$right['DOMAIN'] = null;
		}

		$rightsToInsert[] = array(
			'OBJECT_ID' => $object->getId(),
			'TASK_ID' => $right['TASK_ID'],
			'ACCESS_CODE' => $right['ACCESS_CODE'],
			'DOMAIN' => $right['DOMAIN'],
			'NEGATIVE' => $right['NEGATIVE'],
		);
	}

	RightTable::insertBatch($rightsToInsert);

	return true;
}