bool CMain::SetFileAccessPermission( string path, array permissions, bool overwrite = true )
The method SetFileAccessPermission sets the access permissions for a file or folder.
Parameter | Description |
---|---|
path | Path to the file or folder relative to the root. In case of multiple sites, if the root directory is different, this parameters should specify
an array:
array("site ID", "Path to the file or folder relative to the site root") |
permissions | Array with the access permissions in the format Array("user group ID"=>"permission" [, ...]). The permission can be the following:
|
overwrite | If true, the existing permissions will be overwritten. Optional; true by default. |
Returns true on success or false otherwise.
<? // set the following permissions for the file /en/index.php: // for group #23 - read // for group #5 - write // other groups - deny access if ($APPLICATION->SetFileAccessPermission("/en/index.php", array("23" => "R", "5" => "W", "*" => "D"))) ShowNote("Permissions successfully modified."); ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |