{"title":"TestPermissions attribute","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/attributes/devenv-testpermissions-attribute/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/attributes/devenv-testpermissions-attribute, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/attributes/devenv-testpermissions-attribute","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Specifies a value that can be used to determine which permission sets are used on tests that are run by a test method.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":179,"chars":133},{"level":2,"title":"Syntax","slug":"syntax","at":312,"chars":240},{"level":3,"title":"Arguments","slug":"arguments","at":384,"chars":168},{"level":2,"title":"Remarks","slug":"remarks","at":552,"chars":555},{"level":2,"title":"Related information","slug":"related-information","at":1107,"chars":138}],"text":"> Version: _Available or changed with runtime version 1.0._\nSpecifies a value that can be used to determine which permission sets are used on tests that are run by a test method.\n## Applies to\n Method\n> NOTE\n> The TestPermissions attribute can only be set inside codeunits with the SubType property set to Test.\n## Syntax\n```al\n[TestPermissions(TestPermissions: TestPermissions)]\n```\n### Arguments\nTestPermissions\nType: ../methods-auto/testpermissions/testpermissions-option\nSpecifies the permission sets used on tests that are run by the test method.\n## Remarks\nThe InheritFromTestCodeunit value applies only to test methods. It makes a test method use the TestPermissions property of its test codeunit. On a test codeunit, this value resolves to Restrictive at runtime.\nApart from InheritFromTestCodeunit, the values don't perform operations by themselves. Add code to a test runner codeunit to define which permission sets each value applies at runtime.\n> NOTE\n> To specify the permission sets that are used by all the tests run by a test codeunit, use the ../properties/devenv-testpermissions-property.\n## Related information\nAL Method Reference<../methods-auto/library>\ndevenv-method-attributes\n../properties/devenv-testpermissions-property"}