setOperationsForSite
Rights::setOperationsForSite( $siteId, $rights );
Sets access permissions for a site. Returns true or an error. Method is available only for portal administrator and only for commercial cloud-based subscriptions.
Parameters
Class | Description | Available from version |
---|---|---|
id | Site ID. | |
rights | Object with access permissions with unique IDs as keys (for user, department, groups...), and values are the accessible operations:
Access permissions are independent and can be assigned individually. For example, user can have only publishing access permission without any permission to edit. The following values can be used as keys:
|
Example
if (\Bitrix\Main\Loader::includeModule('landing')) { \Bitrix\Landing\Rights::setOperationsForSite($siteId, [ 'U3' => [ 'edit', 'delete' ], 'U1' => [ 'edit', 'sett' ] ]); }
© «Bitrix24», 2001-2024