• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/rightsmanager.php
  • Класс: BitrixDiskRightsManager
  • Вызов: RightsManager::reformatRightsToOperations
private function reformatRightsToOperations(array $rights)
{
	$operations = array();
	foreach($rights as $right)
	{
		$key = $right['TASK_ID'] . '-' . $right['ACCESS_CODE'];
		if(!empty($right['NEGATIVE']))
		{
			if(isset($operations[$key]))
			{
				unset($operations[$key]);
			}
			continue;
		}

		if(!isset($key))
		{
			$operations[$key] = array();
		}
		$operations[$key][] = $right['NAME'];
	}
	unset($right);

	$operationNames = array();
	foreach($operations as $key => $item)
	{
		$operationNames = array_merge($operationNames, array_values($item));
	}
	unset($key);
	$values = array_values(array_unique($operationNames));

	//https://bugs.php.net/bug.php?id=29972
	return $values? array_combine($values, $values) : array();
}