• Модуль: learning
  • Путь к файлу: ~/bitrix/modules/learning/classes/general/clearnparsepermissionsfromfilter.php
  • Класс: CLearnParsePermissionsFromFilter
  • Вызов: CLearnParsePermissionsFromFilter::ParseRequestedOperations
static function ParseRequestedOperations ($arFilter)
{
	// firstly, ensure that no MIN_PERMISSION given (it's orphaned request)
	if (array_key_exists('MIN_PERMISSION', $arFilter))
	{
		throw new LearnException (
			'EA_PARAMS: outdated "MIN_PERMISSION" key used.',
			LearnException::EXC_ERR_ALL_LOGIC 
			| LearnException::EXC_ERR_ALL_PARAMS);
	}

	// Determine requested operations
	if ( ! isset($arFilter['ACCESS_OPERATIONS']) )
	{
		// no requested operations given, it means that only OP_LESSON_READ opeartions requested.
		$requestedOperations = CLearnAccess::OP_LESSON_READ;
	}
	else
	{
		// requested operations MUST be an integer, because of bitmask nature.
		// and must be > 0
		if ( 
			( ! is_int($arFilter['ACCESS_OPERATIONS']) )
			|| ( ! ($arFilter['ACCESS_OPERATIONS'] > 0) )
		)
		{
			throw new LearnException (
				'EA_PARAMS: bitmask ACCESS_OPERATIONS must be an integer and > 0.',
				LearnException::EXC_ERR_ALL_LOGIC 
				| LearnException::EXC_ERR_ALL_PARAMS);
		}

		// requested operations
		$requestedOperations = $arFilter['ACCESS_OPERATIONS'];
	}

	return ($requestedOperations);
}