enhancement
major
minor
defect
critical
major
minor
major
#30096
Rights System: Remove the configurable group mapper from the ElementAccessManager
Problem
The ElementAccessManager has the group-mapper option. For role rules of type "reference," a configured mapping maps the end object of the rule path to the group that receives the role (RoleRule.getGroupsFor()).
This programmatic mapping is invisible to the incremental rights calculation. The ElementSecurityUpdateManager only detects changes to references located on a rule path, and only then recalculates the affected base objects. If data changes that only the mapper reads, the permissions remain incorrect until the next complete rebuild. This applies, for example, to the ContactGroupMapper: If a different person is assigned to a PersonContact, the group changes without the permissions being recalculated.
Solution
- The mapping to the group is hard-coded in RoleRule: A Group remains itself, a Person is mapped to its representative group, and other objects do not result in a group.
- The group-mapper option is omitted from the ElementAccessManager (GROUP_MAPPER, getGroupMapper()).
- The classes com.top_logic.element.boundsec.manager.rule.GroupMapper (unused copy), com.top_logic.tool.boundsec.manager.SimpleGroupMapper, and com.top_logic.contact.boundsec.manager.rule.ContactGroupMapper are removed.
- Role rules whose path ends at a PersonContact are given an explicit step to the Person. This means that this navigation is also part of the rule path and is updated incrementally. In the demo, this applies to the rules DemoSecurity.A_Role1 and DemoSecurity.A_Role2.
Migration
- Remove the <group-mapper .../> entry from the AccessManager configuration.
- Add a step to the Person to every role rule of type `reference` whose path ends with a ` Contacts:PersonContact `:
{{{#!xml <path> <step attribute="..."/> <step attribute="tl.accounts:Person#contact" inverse="true"/> </path> }}}
- Custom mapping implementations with logic beyond “group or person to group” must be incorporated into the affected role rules as navigation steps. If the mapping does not yet exist as a reference in the model, it must first be modeled there.
- The classes com.top_logic.element.boundsec.manager.rule.GroupMapper, com.top_logic.tool.boundsec.manager.SimpleGroupMapper, and com.top_logic.contact.boundsec.manager.rule.ContactGroupMapper are no longer needed. Any custom code that uses or derives from these classes must remove those references.