TestPermissions Attribute

Version: Available or changed with runtime version 1.0.

Specifies a value that can be used to determine which permission sets are used on tests that are run by a test method.

Applies To

  • Method


The TestPermissions attribute can only be set inside codeunits with the SubType property set to Test.


[TestPermissions(TestPermissions: TestPermissions)]


‚ÄÉType: TestPermissions
Specifies the permission sets used on tests that are run by the test method.

The InheritFromTestCodeunit option value for the TestPermissions argument is only relevant for test methods; not test codeunits. It specifies that a test method uses the TestPermissions property setting of the test codeunit to which it belongs. If you use this value on a test codeunit, the property will resolve to Restrictive at runtime.

Apart from InheritFromTestCodeunit, the values themselves do not perform any operations or have any specific behavior. Instead, you programmatically define what each value does, and the permissions sets it applies at runtime, by adding code in a test runner codeunit.


To specify the permission sets that are used by all the tests run by a test codeunit, use the TestPermissions Property.

See Also

AL Method Reference
Method Attributes
TestPermissions Property