landing.role.setRights
Important! This feature is available for administrator only.
The method sets the required access permissions for list of sites within a role. All other sites, not specified in the input array are deemed detached from the role.
Array keys are site IDs and values - is the array of available operations (nut key means be default access for the role):
- denied - restrict all,
- read – read (access permission is automatically set by the system in addition when specifying any other permission than 'denied'),
- edit – edit (landing page content),
- sett – set settings,
- public – publish,
- delete – delete (to trash bin as well as restore from recycle bin).
Parameters
Parameters | Description | Available from version |
---|---|---|
id | Role ID. | |
rights | Array of sites to assign access permissions. See example. | |
additional | Array with additional access permissions can be passed, enabling the following with a role:
|
Example
BX24.callMethod( 'landing.role.setRights', { id: 11, rights: { '0': ['read'], '66': ['read','edit','sett'] }, additional: ['menu24', 'create'] }, function(result) { if(result.error()) { console.error(result.error()); } else { console.info(result.data()); } } );
© «Bitrix24», 2001-2024