Role
See also: Company value
Value resolver – Abstract
Purpose: Returns the data of a statically selected role.
The Role resolver retrieves the data of the role specified by static selection for the optional Role parameter (see Roles) from the server.
Without any selection for the Role parameter, the return value is 'No value' (null).
A new instance of the Role resolver is added without a selection and appears with an 'empty label', as shown above.
When an exisiting selection (or the 'empty label') is removed by clicking the 'X' symbol within the label, the combobox appears empty. Saving a configuration with a Role resolver in this state will make the 'empty label' reappear.
►IMPORTANT◄ Instead of the Role resolver, an Input object (type safe) resolver for the 'role' type could be used, which is supplied with the ID (id) of a role (e.g. as a static Long value) as input value. Although there are no differences in the runtime behaviour of the two methods, there is an important difference when Lobster Data Platform / Orchestration configurations are exchanged between systems via Meta exchange in the context of implementation. If the Role resolver is used to access a specific role, relevant links between roles (e.g. between test and production systems) are taken into account in the Meta exchange to automatically assign the 'corresponding' role regardless of the ID (id) valid in the respective environment. However, if a role is addressed by a Long value with the Input object (type safe) resolver, then this service does not take effect, which can have a fatal impact on the runtime behaviour of configurations transferred between two systems.
CAUTION
The Role resolver is not available in a Client workflow! The reference to a statically determined role can be established in a Client workflow by performing a Search as a substitute. With regard to the Meta exchange, however, it is not guaranteed that the search criteria used will 'find' the corresponding role (according to the Meta exchange links) across systems.
Configuration
In a Combobox element, the optional Role parameter lists all Roles for a static single selection that have read access in the session in which the resolver is configured. ►NOTE◄ Neither ownership rights nor Company authorizations are relevant for Roles. Within the scope of the configuration, access is granted to the Role of session and all roles that are directly and indirectly subordinate to it. At runtime, the resolver returns the data of the role selected in the configuration without considering access restrictions in the applicable login context. The input value is ignored. |
|
Examples
Example: Criteria for row formatting in an overview
In an overview for Guest users, all guest user accounts should be given an 'alert status' (color scheme 'white/red') through row formatting (see Row formatting in datagrids) that do not refer to a role explicitly intended for guest users.
In the following example, the two roles XF_GUEST and XF_SPECIAL_GUEST (see screenshot in 'Configuration' section) serve as legitimate roles for Guest users.
Runtime example:
The screenshot shows a data grid in a 'Guest user overview', where the first row displays the 'Alert status' (white/red), because the guest user account in question has been assigned a role that should not actually be used for Guest users.
►NOTE◄ Guest users can only be maintained interactively via the default input form, so that specific restrictions for the selection of the role (roleId) cannot be regulated via the Form designer. However, most Guest users are also created automatically (e.g. via Create guest user event action). However, the 'alert status' in the list can also be useful in conjunction with automatic role assignment, e.g. to detect if there are active guest user accounts that deviate from the currently valid positive list for allowed roles.
Configuration:
Within the list settings for the guest user overview, row formatting (see Row formatting in datagrids) is created in the datagrid settings, which defines the 'white/red' color scheme for the 'alert level'. The 'condition' of the row formatting is formatted as shown on the right:
|
|
Example: Cancellation criteria when saving
In the previous example, the rule violation when selecting a role for a guest user account is handled more strictly in the next expansion stage. This is recognizable by the 'alert status' in the row formatting of the guest user overview:
Saving a guest user account with an invalid role (roleId) is effectively prevented by canceling it.
An error message informs the user directly on the reason for the cancellation and permitted options for the role selection.
Runtime example:
Configuration:
An event handler that responds to 'Create' and 'Update' (see Common action event) as Triggering events is configured as shown on the right:
►NOTE◄ Depending on the objective, further criteria could be examined in order to specify the scope of the rule, for example via a Role rule or Company type rule.
|
|
|
An Abort is executed as the Action on passed rule, which is configured as follows:
|
|
|
In Localization, an entry is created in the Resource bundle error for the localization of the error message, whose Resource name corresponds exactly to the Error code (SECURITY_GUEST_USER_ROLE_ALERT).
|
|
|