Documentation

GetFileAccessPermission

string
CMain::GetFileAccessPermission(
 mixed path,
 array groups,
 task_mode=false
)

The method retrieves the access permission of a file or folder. Returns a symbol which defines the access permission:

  • D - access denied;
  • R - read access (view the file contents);
  • U - workflow (edit file in the workflow mode);
  • W - write (direct modification is allowed);
  • X - full access (both direct file modification and editing the access permission are allowed).

Non-static method.

Parameters

ParameterDescription Available from version
path Path to the file or folder relative to the site root. In case of multiple sites, if the DOCUMENT_ROOT of the site of interest is different, pass an array in the following format:
array("site ID", "Path to the file or folder")
groups Array of the user groups ID's for which the access permissions are to be retrieved. If false, permissions for the current user are returned.
Optional; false by default.
task_mode Required to handle the user access permission levels; false by default.

See Also

Examples of use

<?
if ($APPLICATION->GetFileAccessPermission("/en/index.php") <= "D")
   ShowError("Access to file is denied.");
?>


© «Bitrix24», 2001-2024