Codeunit "Permissions Mock"
"Permissions Mock" provides functions that let you simulate any permission set assignment for the current user.
Properties
| Name | Value |
|---|---|
| SingleInstance | True |
Methods
Start
Start mocking Permission Sets.
procedure Start()
Stop
Stop mocking Permission Sets.
procedure Stop()
ClearAssignments
Clears all already assigned Permission Sets from the test user.
procedure ClearAssignments()
Assign
Assigns the given permission set to the test user.
procedure Assign(RoleID: Code[20])
Parameters
| Name | Type | Description |
|---|---|---|
| RoleID | Code[20] |
The Permission Set to set. |
Set
Clears all already assigned Permission Sets and Sets the given Permission Set along side with the All Objects Permission Set that provides execute access to all objects.
procedure Set(RoleID: Code[20])
Parameters
| Name | Type | Description |
|---|---|---|
| RoleID | Code[20] |
The Permission Set to set. |
SetExactPermissionSet
Clears all already assigned Permission Sets and Sets the given Permission Set No additional permissions are provided, even test execution permissions have to be handled manually.
procedure SetExactPermissionSet(RoleID: Code[20])
Parameters
| Name | Type | Description |
|---|---|---|
| RoleID | Code[20] |
The Permission Set to set. |
IsStarted
Get whether permission sets mocking is started
procedure IsStarted(): Boolean
Returns
| Type | Description |
|---|---|
| Boolean |
True if permission sets mocking is started. |