Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions content/docs/analyzers/ApplicationCop/AC0032.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,28 @@ The diagnostic is suppressed when any of the following conditions apply:
- The containing symbol is obsolete
- The codeunit is a test codeunit with `TestPermissions = Disabled`
- The containing object is a `permissionset` or `permissionsetextension` (these declare permissions structurally, not for access control)
- The object contains a database operation on a `RecordRef` (see below)

### RecordRef operations

A `RecordRef` can point to any table, and which table it targets is only known at runtime. When an object contains **any** database operation on a `RecordRef` receiver (`Find`, `FindFirst`, `FindLast`, `FindSet`, `Get`, `GetBySystemId`, `IsEmpty`, `Count`, `Insert`, `Modify`, `ModifyAll`, `Rename`, `Delete`, or `DeleteAll`), the rule cannot determine which declared permission that operation consumes. AC0032 is therefore disabled for the entire object: no unused-permission diagnostics are reported, and the code fix is not offered.

{{< highlight al >}}
codeunit 50100 "Ledger Entry Management"
{
// No AC0032 diagnostics: the RecordRef.Modify call below may target any of these tables at runtime
Permissions =
tabledata "G/L Entry" = md,
tabledata "Cust. Ledger Entry" = md;

procedure DoModify(var RecordRefToModify: RecordRef; RunTrigger: Boolean)
begin
RecordRefToModify.Modify(RunTrigger);
end;
}
{{< /highlight >}}

Note that this also suppresses genuinely unused entries in the same object. This trade-off is deliberate: a false "unused" report combined with the code fix would remove permissions that are required at runtime.

### Temporary tables

Expand Down