Network Locator supports a role-based configuration management approach to allow for fine-grained control over settings and preferences, tailoring the user experience to different groups and users. The basic principle is straightforward - we have default settings that apply universally unless explicitly overridden for a specific role. When a setting is overridden for a role, the overwritten value takes precedence over the default.
Network Locator defines two types of roles:
•Access roles
•Config roles
Access Roles control user access to specific endpoints:
•vnl_acc_user: Required for access to the public Network Locator Client
•vnl_acc_admin: Required for access to the Network Locator Admin Client
•vnl_acc_cockpit: Required for access to the Network Locator Cockpit Client
•Config Roles determine the configuration settings assigned to a user at runtime. They are used to implement the overrides concept.
•To be recognized by the system, a Config Role name must adhere to a specific naming convention.
•It must follow the pattern vnl_cfg_*, where the asterisk (*) can be replaced with an arbitrary name.
Each user may be assigned multiple Access roles, but can only have one Config role at a time. If a user is assigned multiple Config roles, the system will randomly select one of these roles to evaluate the overrides.
•Purpose: Default settings provide a baseline configuration that apply universally to all users, ensuring consistent behavior and experience across the system.
•Example: Suppose the default setting for the allowed print scales is "scales": "500, 1000". This means that unless otherwise specified, all users can choose between these scales
•Purpose: Role-specific settings allow customization of the default behavior for particular groups of users based on their roles, enhancing usability and efficiency.
•Example: If an internal group of users requires additional print scales, we can override the default setting for this role to, say, "scales": "100, 250, 500, 1000"
•Inheritance of Default Settings:
oAll roles initially inherit the default settings, forming the foundational configuration for every role.
•Overwriting Default Settings:
oWhen a role requires a different configuration for a particular setting, this setting is explicitly overridden. The overridden value takes precedence over the default value.
oOnly the specified settings are overridden; the rest of the default settings remain unchanged and continue to apply to the role.
•Precedence of Role-Specific Settings:
oThe system always checks for role-specific settings first. If a setting is overridden for a role, the overridden value is used.
oIf no role-specific override is found for a setting, the system falls back to the default setting.
To implement this role-based configuration management, we introduce a new level in the process-manager configuration. This new level allows for partial overrides of the settings. The JSON structure stored in the database is organized as follows:
{
"vertigis": {
"network-locator": {
"default": {
...
"print-output": {
...
"scales": "250,500,1000"
}
},
"overrides": {
"vnl_cfg_user": {
"scales": "100, 250, 500,1000"
}
}
}
}
}
default: Contains the base set of configurations that apply universally unless overridden.
overrides: Contains a map of role-specific overrides, which can include a subset of the base configuration set.