• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/marketplace/application.php
  • Класс: BitrixRestMarketplaceApplication
  • Вызов: Application::setRights
static function setRights($appId, $rights) : array
{
	$result = [];
	// todo: maybe can add self::$contextUser to isAdmin check
	if (CRestUtil::isAdmin())
	{
		if ($appId > 0)
		{
			$appInfo = AppTable::getByClientId($appId);
			if ($appInfo['CODE'])
			{
				Analytic::logToFile(
					'setAppRight',
					$appInfo['CODE'],
					$appInfo['CODE']
				);
			}
			AppTable::setAccess($appId, $rights);
			PlacementTable::clearHandlerCache();
			$result = ['success' => 1];
		}
	}
	else
	{
		$result = ['error' => Loc::getMessage('RMP_ACCESS_DENIED')];
	}

	return $result;
}