Documentation

Field settings

User (custom) fields are widely used in the product. Until recently the only "general" settings interface was located in the administrative section.

Bitrix24 Cloud doesn't have administrative section, which complicates access to settings. Each module that uses user fields was creating its own interfaces for showing and managing user field settings. At the same time, the set of these settings is absolutely identical for all modules.

User fields in the RPA (Robotic Process Automation) module are used as the main method of data storage. Field settings interface was required, similar to the interface in the administrative section or CRM.

Decision was made to create a unified access interface as well a single entry point for REST.

Because the access to settings was granted to limited number of users (and for some user fields, for example, type UF_DEPARTMENT, no access should be granted at all), the following diagram was developed:

  • Kernel has an abstract class UserFieldAccess, responsible for limiting access to settings;
  • Each module must have its own descendant of this class;
  • Descendant is specified via the module's .settings.php file.

All queries to user field settings via public section or via REST indicate the module ID. Module settings are uploaded using ID and contain the path to descendant file:

  • When the path is not found, prints an error:
  • When path is found, descendant defines which settings are available for user.

To find a descendant, indicate the record in the file .settings.php as follows:


return [
    'userField' => [
        'value' => [
            'access' => 'MyModule\\UserFieldAccess', // FQN-path to descendant
        ],
    ],
];

Public section

Components

  • Component main.field.config.list - list of fields;
  • Component main.field.config.detail - field settings.

Components are connected in files within public section intranet in the folder with files for portal settings:

  • Bitrix24 Cloud
    • /settings/configs/userfield_list.php for list;
    • /settings/configs/userfield_detail.php for settings.
  • Bitrix24 Self-hosted
    • /configs/userfield_list.php for list;
    • /configs/userfield_detail.php for settings.

Actual path to file can be received via the methods \Bitrix\Intranet\Util::getUserFieldListConfigUrl()and \Bitrix\Intranet\Util::getUserFieldDetailConfigUrl()



© «Bitrix24», 2001-2024