Documentation

landing.role.setAccessCodes

Important! This feature is available for administrator only.

The method sets access codes for a role (with its limits for sites). Role ID and access codes array are passed to the method. If the array is empty, codes for the role will be reset.

Array keys are unique IDs (user IDs, department and group IDs, etc.), and the following available operations - are values:

  • denied – access denied (when this permission is set - all other defined access permissions are reset for a specific object)
  • 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).

Access permissions are independent and can be granted selectively. For example, user can have only access permission to publish without option to do any edits.

The following values can be used as keys:

  • SG - workgroup with ID=X;
  • U - user with ID=X;
  • DR - department with ID=X, including subdepartments;
  • UA - all authorized users.
  • G - user group (for example, G2).

Parameters

ParameterDescriptionVersion
idRole identifier.
codesArray of access codes.

Examples

BX24.callMethod(
   'landing.role.setAccessCodes',
   {
      id: 11,
      codes: [
         'SG3_A', 'G4'
      ]
   },
   function(result)
   {
      if(result.error())
      {
         console.error(result.error());
      }
      else
      {
         console.info(result.data());
      }
   }
);


© «Bitrix24», 2001-2024
Up