Repository navigation
fix(AC0032): DeleteAll and ModifyAll require Read - #582
Merged
Merged
Conversation
DeleteAll and ModifyAll need Read in addition to Delete and Modify at runtime. Add AC0032 NoDiagnostic/HasFix fixtures and AC0031 HasDiagnostic/HasFix fixtures for the implied Read, plus regression fixtures showing Delete, Modify and Insert stay single-letter. The implied-read fixtures fail against the current one-to-one map. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
At runtime DeleteAll needs Read plus Delete and ModifyAll needs Read plus Modify; the single-record Delete, Modify and Insert need only their own permission. MethodOperationMap mapped them one-to-one, so AC0032 reported the r in rd next to a DeleteAll as unused (and its CodeFix removed it) and AC0031 never reported a missing r. Add MethodOperationMap.ImpliesRead and RequiredPermissionDetector.TryGetImpliedRead, and have both consumers add the implied Read permission next to the primary one. AC0032 adds it at the single collection point, so every receiver path (variable map, symbol-info fallback, implicit self) is covered. RecordRef receivers keep their existing bailout. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Add the design decision with the runtime evidence to the AC0031 and AC0032 rule docs and note the permission-only nature of the implied Read in the RecordMethodClassification guide. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…eses Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Arthurvdv
force-pushed
the
fix/ac0032-deleteall-modifyall-require-read
branch
from
October 11, 2026 08:40
3dfbb3a to
61accd9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DeleteAllandModifyAllneed Read in addition to Delete and Modify at runtime, butMethodOperationMapmapped them one-to-one. AC0032 therefore reported therinrdnext to aDeleteAllas unused (and its CodeFix removed it), and AC0031 never reported a missingr.Runtime probe on a BC sandbox (user with only indirect
rimdon a custom table; each scenario codeunit'sPermissionswas the only grant):i/d/malonerInsertDelete(false/true)Modify(false/true)DeleteAll(false/true), filtered or notrdworksModifyAll(false/true), filtered or notrmworksFindFirstr(already modelled)Design:
MethodOperationMap.ImpliesRead(methodName)flags the two methods andRequiredPermissionDetector.TryGetImpliedReadbuilds the extra ReadRequiredPermission. AC0031 reports/checks it next to the primary permission; AC0032 adds it at its single collection point, so the variable-map fast path, symbol-info fallback and bare/implicit-self paths all get it.Insert,ModifyandDeletestay single-letter. RecordRef receivers keep their existing handling.Behaviour change
AC0031 now reports a missing
ron objects declaring onlyd(or onlym) while callingDeleteAll(ModifyAll). This includes patterns Microsoft ships in the Base App, e.g. codeunit 382BankAccStmtLines-Delete(Permissions = TableData "Bank Account Statement Line" = d;withDeleteAll()), which the runtime evidence shows is genuinely missingr. AC0032 stops flaggingrnext to these calls and still flagsi/m.Companion docs PR: ALCops/alcops.dev#202
Test plan
rd+DeleteAll,rm+ModifyAll (filtered/unfiltered, run-trigger true), bare self call in a table; AC0032 HasDiagnostic and HasFixrimd+DeleteAll/ModifyAll keepr; AC0031 HasDiagnosticd+DeleteAll,m+ModifyAll; AC0031 HasFix addsr; AC0031 NoDiagnostic regression ford+Delete,m+Modify,i+Insert.dotnet test ALCops.slngreen,dotnet format --verify-no-changesclean, Release all-TFM builds of Common, ApplicationCop, LinterCop, PlatformCop, FormattingCop withContinuousIntegrationBuild=true,Validate-Rules.ps1OK./code-review high, 1 round: no confirmed correctness findings. Justified: (1) two AC0031 diagnostics on oneDeleteAllwhen neither letter is covered, intended and consistent withDataTransfer(one per missing letter; the fixtures pass); (2) syntactic method name on the fast path is a pre-existing imprecision shared with the primary operation; (3)/(4) single helper pair kept for a minimal diff; the "unrelated commits" findings were a wrong base in the review and do not apply (3 commits ahead oforigin/main).Refs #574
🤖 Generated with Claude Code