Documentation

CheckFilesAccessibilityByUser

array
CTaskFiles::checkFilesAccessibilityByUser(
	array $arFilesIds,
	$userId
);

This method checks the file accessibility (within task module) for a specified user.

Note: This method accepts an array of configuration parameters and generates scripts, necessary to show file dialog. Static method.

Method parameters

ParameterDescription
$arFilesIdsArray of IDs for checked files.
$userIdID of the user for which the file accessibility is checked.

Returned value

Method is similar to CTaskFiles::isFileAccessibleByUser(), except that it works with an array of file IDs and returns an associative array, describing which files are accessible to a user. Array keys are string of the 'f'.$fileId type (see. the example below), array values are true (if the file is available) or false (if the file is unavailable).

Examples of use

<?php
CModule::IncludeModule('tasks');
$arCheckFiles = array(113, 456, 777);
$userId = (int) $GLOBALS['USER']->getId();
$rc = CTaskFiles::checkFilesAccessibilityByUser($arCheckFiles, $userId);
var_dump ($rc);

The result will be approximately as follows:
array(3) {
	["f113"]=> bool(true)
	["f456"]=> bool(true)
	["f777"]=> bool(false)
} 
?>


© «Bitrix24», 2001-2024