Documentation

documentgenerator.role.add

documentgenerator.role.add(fields)

The method adds new role. Returns the same data as when getting new role documentgenerator.role.get() for a new region.

Parameters

Parameter Description
fieldsArray of role fields, including:
  • name - role name (required)
  • code - role code
  • permissions - role access permissions. An array as follows:
  • "permissions": {
        "settings": {
            "modify" : "X",
        },
        "templates": {
            "modify" : "X",
        },
        "documents": {
            "modify" : "X",
            "view" : "X",
        },
    }
    

First key - entity, second key - action, value - is the level of access permissions. When empty array is passed the role won't have any access permissions. There are the following levels: empty value - no access permission, A - for current user, D - for current user and members of the current department, X - all access permissions.

Levels A and D have value only for permissions[templates][modify].





© «Bitrix24», 2001-2024