enhancement
major
minor
defect
critical
major
minor
major
#30066
React Administration: View and Explain an Account's Effective Permissions on an Object (Role Inspector)
Split from #30047; related: #29767, #29108.
Context
The classic interface has a role inspector (com.top_logic.element, admin/security/roleInspector/showSecurity.layout.xml, ShowSecurityComponent) that lists the roles of an account stored in the security store on objects. In contrast, the React Administration’s access management (accounts, groups, roles, permissions, coverage) describes access definitions only on a per-type basis: which role has which operation on a type and whether the definition is complete. The typical support question “Why is (or isn’t) Account X allowed to edit this object?” cannot be answered there.
New Behavior
In the React Administration, there is a new view under Access Management → Effective Rights:
- Input: an account, optionally a type, and optionally an object: The type tree displays the model’s modules with their classes; the table below shows the objects of the selected type. “Reset Selection” clears the type selection; “Deselect Object” clears the object selection.
- Account and object selected:
- Operations: For each operation applicable to the object’s type, the view shows whether the account is permitted to perform it, the granting roles (the authorizing roles held by the account), the authorizing roles, whether the account—as a restricted user—is not permitted to perform the operation at all, and a justification. If the type delegates the decision to an access parent, the view lists the object on which the decision is made and, for each operation, the operation being checked there (e.g., deleting a milestone is checked as modifying the project). An administrator, a restricted user, and a type marked as “internal” or “without-security” are displayed as a note.
- Held roles: every role that the account has on the object in question, along with its source (direct role assignment or role rule [rule ID]), the object on which it exists (for a role inherited via a role parent, the role parent), and the group through which the account holds it (the account itself or group G).
- No object selected: the account’s role assignments with object, role, source, rule, and group, filterable via the role column (the scope of the open query in the classic role inspector). If a type is selected, only the assignments to instances of that type (including its specializations); otherwise, to any objects.
The classic Role Inspector remains unchanged.
Solution
- The EffectiveAccess analysis (com.top_logic.element, package boundsec.manager.explain) does not calculate a decision or a role itself: The decisions are made by the access check (ModelAccessRights.isAllowed, in the context of the account being checked, so that exceptions for administrators and restricted users apply to that account and not to the querier); the AccessManager provides the held roles, and the sources (group, rule, role parent) are the entries in the SecurityStorage of the StorageAccessManager. If no security store is available, the view displays decisions and roles without sources and explains this.
- General extensions for this: ModelAccessRights.getRoleHolder, getOperationOnRoleHolder, and getAdmittingRoles (in SecurityConfigurationService from the existing delegation logic), SecurityStorage.getEntries (entries with a reason, filtered by groups, objects, and roles), BoundedRole.roleAssignmentsForGroup, and ElementAccessManager.getGroups are public.
- The view admin/access-control/effective-access.view.xml is a pure .view.xml file using the TL-Script functions effectiveAccess* (EffectiveAccessFunctions, for administrators only). The type tree is a <tree-table> using tl.model:TLModule / tl.model:TLClass; the selectedType channel is derived from the tree selection and contains only one class (a selected module does not filter). The filter for the assignments is instanceOf($selectedType) in TL-Script.
Test
- TestEffectiveAccess (com.top_logic.element): direct assignment, role rule, role via a group, role inherited via a role parent, delegation to an access parent with a verified operation, denied operation, type without access control, administrator, restricted user, open query with and without role filters.
- tl-demo-react (/view/, root / root1234), Administration → Access Management → Effective Rights: Type filter on a class and a superclass, module selected (no filter), “Deselect Object” retains the type filter, “Reset Selection” clears both type and object.