Skip to content
Merged
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
12 changes: 12 additions & 0 deletions content/docs/analyzers/ApplicationCop/AC0031.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@ Only the permissions in the mask count, regardless of casing: with `= RD`, reads

Namespace-qualified references (`tabledata MyNamespace."My Table" = r`) and object ID references (`tabledata 50100 = r`) are both recognized.

### Extension objects

The diagnostic is also reported in table and page extensions, for example when a procedure or trigger in a `pageextension` reads a table other than the page's `SourceTable`. These accesses cannot be covered in place:

- Extension objects cannot declare the `Permissions` property.
- The method-level `[InherentPermissions]` attribute only accepts objects from the same extension, so pointing it at a Base Application table fails with [AL0720](https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/diagnostics/diagnostic-al720).

For the same reason, the code fix is not offered on extension objects. To comply, move the data access into an object that can declare `Permissions`, such as a codeunit, and call it from the extension.

Allowing the `Permissions` property on extension objects is an open request to Microsoft: [Set permissions on page- and table extensions](https://experience.dynamics.com/ideas/idea/?ideaid=9402e200-a6e5-e911-b3b9-0003ff68a105). It is marked as needing votes and is not on Microsoft's roadmap yet, so add your vote if this affects you.

### Temporary tables

Temporary tables never touch the database, so they never require permissions. The diagnostic is suppressed for every way a temporary table can be implemented:
Expand All @@ -210,3 +221,4 @@ Temporary tables never touch the database, so they never require permissions. Th
- [Permissions on database objects](https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-permissions-on-database-objects) on Microsoft Learn
- [InherentPermissions property](https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-inherentpermissions-property) on Microsoft Learn
- [Indirect permissions](https://learn.microsoft.com/en-us/dynamics365/business-central/ui-define-granular-permissions) on Microsoft Learn
- [Set permissions on page- and table extensions](https://experience.dynamics.com/ideas/idea/?ideaid=9402e200-a6e5-e911-b3b9-0003ff68a105) on Dynamics 365 Ideas
Loading