[Bug 640454] Scope Expense Agent Entra permissions by company - #11290
[Bug 640454] Scope Expense Agent Entra permissions by company#11290Prangshuman Das (t-prda) wants to merge 10 commits into
Conversation
d690d70 to
c27ec37
Compare
Good Sense Reviewer - Round 1Recommendation: Request ChangesWhat this PR doesThis change moves Expense Agent Entra application handling into one codeunit. Activation now adds the Expense Agent permission for the current company, and deactivation removes only the current-company permission before disabling the shared application only when no company permissions remain. The functional approach matches the company-copy problem, and the new tests cover activation and deactivation with current-company, other-company, and unrelated permissions. However, the current build reports new overflow warnings in the changed app and test code, and those warnings are treated as failures. The PR is not merge-ready until those warnings are removed. Problem-solution fitFit: Strong The reported scenario is that a copied company keeps the old company permission for the Expense Agent application user, so activation in the copied company can still use the wrong company. The diff addresses that by checking and maintaining permissions per company, while keeping the shared application enabled when another company still uses it. SuggestionsS1 (🔴 High): Fix new company-name overflow warnings Risk assessment and necessityRisk: The changed surface controls the Entra application user and its company-scoped permissions for Expense Agent activation and deactivation. A wrong permission row can block activation in copied companies or remove access for another company. The logic is narrow and tested, but the build-blocking warnings must be fixed before the change can safely go in. Necessity: The change is justified. Without it, a copied company can keep using a permission row from the source company, and the manual mitigation requires changing application state and permissions by hand. The scope is appropriate for the bug once the build is clean.
|
|
Addressed the build-blocking AA0139 findings in 50295b0 by bounding all new company-name values to Text[30]. Also scoped Expense Agent permission resolution by App ID and scope and switched the AAD lookup to Get(). The seven configuration lifecycle scenarios pass individually on tenant1-1; analyzer output has no warnings in changed files. |
Pull request was converted to draft
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 520d66e2-67cf-44bb-8863-5c195128151b
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 520d66e2-67cf-44bb-8863-5c195128151b
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 520d66e2-67cf-44bb-8863-5c195128151b
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 520d66e2-67cf-44bb-8863-5c195128151b
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 520d66e2-67cf-44bb-8863-5c195128151b
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 520d66e2-67cf-44bb-8863-5c195128151b
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 520d66e2-67cf-44bb-8863-5c195128151b
14844db to
bba1520
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 520d66e2-67cf-44bb-8863-5c195128151b
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 520d66e2-67cf-44bb-8863-5c195128151b
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 520d66e2-67cf-44bb-8863-5c195128151b
Summary
Validation
tenant1-1AAD Applicationstate validation and confirmed enable/disable changes the backing user state without deleting other-company access-control rowsManual verification
Fixes AB#640454