mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-06 17:36:53 +01:00
28 lines
805 B
AL
28 lines
805 B
AL
codeunit 50102 "Customer Permission Tests"
|
|
{
|
|
Subtype = Test;
|
|
TestPermissions = Restrictive;
|
|
var
|
|
Assert: Codeunit Assert;
|
|
|
|
[Test]
|
|
procedure CustomerReadFailsWithoutPermission()
|
|
var
|
|
Customer: Record Customer;
|
|
begin
|
|
// Restrictive: test runner assigns no permission sets to the test user.
|
|
asserterror Customer.FindFirst();
|
|
Assert.ExpectedError('You do not have the following permissions');
|
|
end;
|
|
|
|
[Test]
|
|
[TestPermissions(TestPermissions::Disabled)]
|
|
procedure AdminCanReadAllCustomers()
|
|
var
|
|
Customer: Record Customer;
|
|
begin
|
|
// Disabled overrides codeunit-level Restrictive for this test only.
|
|
// Use for paths that legitimately require elevated access.
|
|
Customer.FindFirst();
|
|
end;
|
|
}
|