Skip to content

[W1][Codeunit][8900][Email Impl] SourceRecordRef.ReadPermission() condition was removed from FilterRemovedSourceRecords-procedure. Fixes AB#8635#8708

Open
dkastena wants to merge 3 commits into
microsoft:mainfrom
dkastena:fix/business-central-bug-Add_OnBeforeIntegrationEvent_in_FilterRemovedSourceRecords
Open

[W1][Codeunit][8900][Email Impl] SourceRecordRef.ReadPermission() condition was removed from FilterRemovedSourceRecords-procedure. Fixes AB#8635#8708
dkastena wants to merge 3 commits into
microsoft:mainfrom
dkastena:fix/business-central-bug-Add_OnBeforeIntegrationEvent_in_FilterRemovedSourceRecords

Conversation

@dkastena

@dkastena dkastena commented Jun 22, 2026

Copy link
Copy Markdown

What & why

If at least one security filter is applied to the “Purchase Header” table, the user will have a problem when pushing the 'Add file from source document’ action on the “Email Attachments” subpage.
Result:
Message: "Did not find any attachments related to this email"
Expected result:
The page should show the list of attachments from the source purchase document. Like it works without applying security filters.

Linked work

Fixes AB#8635

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)

GetBySystemId() already respects the user's security filter.
The blanket ReadPermission() check was the real problem because it:

  • Bypasses fine-grained filters the admin set up
  • Acts as an all-or-nothing gate instead of respecting row-level filtering
  • Prevents filtered access even when the user should see specific records

By removing it, we let GetBySystemId() do what it's designed to do—check permissions filter-aware.

Risk & compatibility

@dkastena dkastena requested a review from a team June 22, 2026 09:11
@github-actions github-actions Bot added AL: System Application From Fork Pull request is coming from a fork labels Jun 22, 2026
@dkastena dkastena changed the title [W1][Codeunit][8900][Email Impl] Add OnBefore IntegrationEvent in FilterRemovedSourceRecords-procedure. Fixes for issue #8635 [W1][Codeunit][8900][Email Impl] Add OnBefore IntegrationEvent in FilterRemovedSourceRecords-procedure. Fixes #8635 Jun 22, 2026
@dkastena dkastena changed the title [W1][Codeunit][8900][Email Impl] Add OnBefore IntegrationEvent in FilterRemovedSourceRecords-procedure. Fixes #8635 [W1][Codeunit][8900][Email Impl] Add OnBefore IntegrationEvent in FilterRemovedSourceRecords-procedure. Fixes AB#8635 Jun 22, 2026
@dkastena dkastena changed the title [W1][Codeunit][8900][Email Impl] Add OnBefore IntegrationEvent in FilterRemovedSourceRecords-procedure. Fixes AB#8635 [W1][Codeunit][8900][Email Impl] SourceRecordRef.ReadPermission() condition was removed from FilterRemovedSourceRecords-procedure. Fixes AB#8635 Jun 22, 2026
@github-actions github-actions Bot added the Linked Issue is linked to a Azure Boards work item label Jun 22, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jun 22, 2026
@github-actions github-actions Bot added the needs-approval Workflow runs require maintainer approval to start label Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: System Application From Fork Pull request is coming from a fork Linked Issue is linked to a Azure Boards work item needs-approval Workflow runs require maintainer approval to start

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant