Skip to content

Fix effective permission filtering#9692

Open
darjoo wants to merge 4 commits into
mainfrom
darjoo-fix-effective-permissions-filters
Open

Fix effective permission filtering#9692
darjoo wants to merge 4 commits into
mainfrom
darjoo-fix-effective-permissions-filters

Conversation

@darjoo

@darjoo darjoo commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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 0 only 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

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome (required - be specific: scenarios, commands, screenshots for UI changes)

  • Built and installed the changed System Application, Base Application, and Tests-Permissions packages against Business Central 29.0.52770.0.
  • Ran PopulatePermissionBufferPrefersSpecificObjectOverWildcard; it passed and confirmed an exact direct grant is displayed instead of an indirect wildcard grant.
  • Ran 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.

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>
@darjoo
darjoo requested a review from a team July 23, 2026 11:54
@github-actions github-actions Bot added the Integration GitHub request for Integration area label Jul 23, 2026
Combine exact-object and wildcard fallback selection behind a single lookup helper.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 23, 2026
darjoo and others added 2 commits July 23, 2026 14:01
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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Style}$

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Style}$

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Integration GitHub request for Integration area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant