Fix effective permission filtering#9692
Conversation
Prefer exact object permissions over wildcard permissions when populating the permission-set detail buffer, including explicit exclusions. Add regression coverage for both precedence scenarios. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Combine exact-object and wildcard fallback selection behind a single lookup helper. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Restore the original inline exact-object and wildcard fallback lookup. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| TenantPermissionSet: Record "Tenant Permission Set"; | ||
| TenantPermission: Record "Tenant Permission"; | ||
| AccessControl: Record "Access Control"; | ||
| PermissionBuffer: Record "Permission Buffer" temporary; |
There was a problem hiding this comment.
The temporary Record variable in the new test PopulatePermissionBufferPrefersSpecificObjectOverWildcard is named PermissionBuffer instead of TempPermissionBuffer. The file already follows the Temp-prefix convention elsewhere (e.g. TempPermissionSetBuffer), so this new declaration and its five usages in the method (var declaration and the calls to PopulatePermissionBuffer, SetRange, FindFirst, and the Assert.AreEqual comparisons) should be renamed to make clear it is an in-memory buffer, not a database write.
Knowledge:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.14.4
| TenantPermissionSet: Record "Tenant Permission Set"; | ||
| TenantPermission: Record "Tenant Permission"; | ||
| AccessControl: Record "Access Control"; | ||
| PermissionBuffer: Record "Permission Buffer" temporary; |
There was a problem hiding this comment.
The temporary Record variable in the new test PopulatePermissionBufferPrefersSpecificEmptyOverWildcard is named PermissionBuffer instead of TempPermissionBuffer. The file already follows the Temp-prefix convention elsewhere (e.g. TempPermissionSetBuffer), so this new declaration and its five usages in the method should be renamed to make clear it is an in-memory buffer, not a database write.
Knowledge:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.14.4
What & why
Filtering the Effective Permissions page could make the By Permission Set pane show wildcard permissions instead of the selected object's specific permission. This made the UI inconsistent even though effective authorization was calculated correctly.
Populate the permission buffer using the exact object ID first and fall back to wildcard object ID
0only when no exact record exists. Exact records with blank permissions remain explicit exclusions and therefore also take precedence over wildcard grants.Linked work
N/A - this internal fix is tracked by the Azure DevOps work item below.
AB#615963
How I validated this
What I tested and the outcome (required - be specific: scenarios, commands, screenshots for UI changes)
PopulatePermissionBufferPrefersSpecificObjectOverWildcard; it passed and confirmed an exact direct grant is displayed instead of an indirect wildcard grant.PopulatePermissionBufferPrefersSpecificEmptyOverWildcard; it passed and confirmed an exact exclusion is displayed instead of a wildcard grant.Risk & compatibility
Low risk. The change affects only the permission-set breakdown buffer used by the Effective Permissions UI; merged effective authorization remains unchanged. No schema, upgrade, telemetry, or feature-flag impact.