• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/controller/onlyoffice.php
  • Класс: BitrixDiskControllerOnlyOffice
  • Вызов: OnlyOffice::configureActions
public function configureActions()
{
	return [
		'handleEndOfTrialFeature' => [
			'+prefilters' => [
				new CloseSession(),
			],
		],
		'loadDocumentEditor' => [
			'-prefilters' => [Csrf::class],
		],
		'loadCreateDocumentEditor' => [
			'-prefilters' => [Csrf::class],
		],
		'loadDocumentViewer' => [
			'-prefilters' => [Csrf::class],
		],
		'loadDocumentEditorByViewSession' => [
			'-prefilters' => [Csrf::class],
			'+prefilters' => [
				(new DocumentOnlyOfficeFiltersDocumentSessionCheck())
					->enableOwnerCheck()
					->enableHashCheck(function(){
						return Context::getCurrent()->getRequest()->get('documentSessionHash');
					})
				,
			],
		],
		'renameDocument' => [
			'+prefilters' => [
				new HttpMethod([HttpMethod::METHOD_POST]),
				new ContentType([ContentType::JSON]),
				(new DocumentOnlyOfficeFiltersDocumentSessionCheck())
					->enableOwnerCheck()
					->enableHashCheck(function(){
						return (new JsonPayload())->getData()['documentSessionHash'];
					})
				,
			],
		],
		'endSession' => [
			'+prefilters' => [
				new HttpMethod([HttpMethod::METHOD_POST]),
				new ContentType([ContentType::JSON]),
				(new DocumentOnlyOfficeFiltersDocumentSessionCheck())
					->enableOwnerCheck()
					->enableHashCheck(function(){
						return (new JsonPayload())->getData()['documentSessionHash'];
					})
				,
			],
		],
		'continueWithNewSession' => [
			'+prefilters' => [
				new HttpMethod([HttpMethod::METHOD_POST]),
				new ContentType([ContentType::JSON]),
				(new DocumentOnlyOfficeFiltersDocumentSessionCheck())
					->enableOwnerCheck()
					->enableHashCheck(function(){
						return (new JsonPayload())->getData()['documentSessionHash'];
					})
				,
			],
		],
		'recoverSessionWithBrokenFile' => [
			'+prefilters' => [
				new HttpMethod([HttpMethod::METHOD_POST]),
				new ContentType([ContentType::JSON]),
				(new DocumentOnlyOfficeFiltersDocumentSessionCheck())
					->enableOwnerCheck()
					->enableHashCheck(function(){
						return (new JsonPayload())->getData()['documentSessionHash'];
					})
				,
			],
		],
		'handleOnlyOffice' => [
			'prefilters' => [
				new DocumentOnlyOfficeFiltersOnlyOfficeEnabled(),
				new ContentType([ContentType::JSON]),
				new DocumentOnlyOfficeFiltersAuthorization(
					ServiceLocator::getInstance()->get('disk.onlyofficeConfiguration')->getSecretKey()
				),
			],
		],
		'download' => [
			'prefilters' => [
				new DocumentOnlyOfficeFiltersOnlyOfficeEnabled(),
				new DocumentOnlyOfficeFiltersAuthorization(
					ServiceLocator::getInstance()->get('disk.onlyofficeConfiguration')->getSecretKey(),
					[
						'documentSessionHash',
					]
				),
			],
		],
	];
}