/aldc:skill-permissionsfrom ALDC for Claude Code
AL permission set design for Business Central. Use when creating PermissionSets, implementing least-privilege access, or designing security models for extensions.
Ships in ALDC for Claude Code. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Generate and manage permission sets for AL Business Central extensions following the principle of least privilege: role-based permission design, AL vs XML formats, permission set extensions, and security validation.
This skill should be loaded when:
Generate with the VS Code permission-set generation command (not an agent tool), then refine:
permissionset 50100 "Contoso Sales"
{
Assignable = true;
Caption = 'Contoso Sales Permissions';
Permissions =
// Tables — object-level execute
table "Contoso Sales Setup" = X,
table "Contoso Discount Rule" = X,
// Table data — RIMD granularity
tabledata "Contoso Sales Setup" = R, // read-only for most users
tabledata "Contoso Discount Rule" = RIMD, // full CRUD
// Executable objects
codeunit "Contoso Sales Management" = X,
page "Contoso Sales Setup Card" = X,
page "Contoso Discount Rules List" = X,
report "Contoso Sales Summary" = X,
xmlport "Contoso Sales Import" = X;
}
Permission letters for tabledata:
| Letter | Meaning | Grant when… |
|---|---|---|
R | Read | User needs to view data |
I | Insert | User needs to create records |
M | Modify | User needs to edit existing records |
D | Delete | User needs to remove records (grant sparingly) |
For non-tabledata objects (table, codeunit, page, report, xmlport, query):
X = Execute / Run0 = No permission (omit the line instead)Design a layered permission structure — each role includes only what it needs:
// Layer 1: Base — read-only access shared by all roles
permissionset 50100 "Contoso Base"
{
Assignable = false; // not directly assignable to users
Caption = 'Contoso Base (Read)';
Permissions =
tabledata "Contoso Sales Setup" = R,
tabledata "Contoso Discount Rule" = R,
page "Contoso Sales Setup Card" = X,
page "Contoso Discount Rules List" = X;
}
// Layer 2: User — standard operations (includes Base)
permissionset 50101 "Contoso User"
{
Assignable = true;
Caption = 'Contoso User';
IncludedPermissionSets = "Contoso Base";
Permissions =
tabledata "Contoso Discount Rule" = IM, // create + edit (no delete)
codeunit "Contoso Sales Management" = X,
report "Contoso Sales Summary" = X;
}
// Layer 3: Admin — full control (includes User)
permissionset 50102 "Contoso Admin"
{
Assignable = true;
Caption = 'Contoso Admin';
IncludedPermissionSets = "Contoso User";
Permissions =
tabledata "Contoso Sales Setup" = RIMD, // full CRUD on setup
tabledata "Contoso Discount Rule" = D, // adds Delete
xmlport "Contoso Sales Import" = X; // data import only for admin
}
Design rules:
Assignable = false for base/internal layers — only assign leaf-level sets to usersIncludedPermissionSets builds hierarchy — no need to repeat parent permissionsExtend existing BC permission sets to include your extension's objects — so users with standard roles automatically get access:
permissionsetextension 50100 "Contoso D365 Sales Ext" extends "D365 SALES"
{
Permissions =
tabledata "Contoso Discount Rule" = RIMD,
codeunit "Contoso Sales Management" = X,
page "Contoso Discount Rules List" = X;
}
permissionsetextension 50101 "Contoso D365 Read Ext" extends "D365 READ"
{
Permissions =
tabledata "Contoso Sales Setup" = R,
tabledata "Contoso Discount Rule" = R,
page "Contoso Sales Setup Card" = X;
}
When to use permissionsetextension:
Generate the XML format via the VS Code permission-set command (not an agent tool) when:
<?xml version="1.0" encoding="utf-8"?>
<PermissionSets>
<PermissionSet RoleID="CONTOSO-SALES" RoleName="Contoso Sales Permissions">
<Permission>
<ObjectType>0</ObjectType> <!-- TableData -->
<ObjectID>50100</ObjectID>
<ReadPermission>1</ReadPermission>
<InsertPermission>1</InsertPermission>
<ModifyPermission>1</ModifyPermission>
<DeletePermission>0</DeletePermission>
</Permission>
<Permission>
<ObjectType>5</ObjectType> <!-- Codeunit -->
<ObjectID>50100</ObjectID>
<ExecutePermission>1</ExecutePermission>
</Permission>
</PermissionSet>
</PermissionSets>
XML ObjectType codes: 0 = TableData, 1 = Table, 3 = Report, 5 = Codeunit, 6 = XMLport, 8 = Page, 9 = Query.
Prefer AL format for new development — it lives in source control, participates in build, and supports IncludedPermissionSets.
Some objects are accessed indirectly (via codeunit calls) and need indirect permission:
// In the codeunit that accesses data on behalf of the user
codeunit 50100 "Contoso Sales Management"
{
Permissions =
tabledata "Contoso Internal Log" = RIMD; // indirect — user doesn't access directly
}
For test codeunits, set the permission level to validate security:
codeunit 50200 "Contoso Sales Test"
{
Subtype = Test;
TestPermissions = Restrictive; // NonRestrictive | Restrictive | Disabled
[Test]
procedure TestUserCanCreateDiscount()
var
PermissionsMock: Codeunit "Library - Lower Permissions";
begin
// Simulate a user with only "Contoso User" permissions
PermissionsMock.SetOutsidePermissionSet("Contoso User");
// Test that user CAN create discount rule
// ...
end;
}
Permissions property on codeunit)STOP — present the permission matrix to the user before generating:
| Object | Type | Base (R) | User | Admin |
|---|---|---|---|---|
| Contoso Sales Setup | tabledata | R | R | RIMD |
| Contoso Discount Rule | tabledata | R | RIM | RIMD |
| Contoso Sales Mgmt | codeunit | — | X | X |
| Contoso Sales Import | xmlport | — | — | X |
Justify each permission and confirm the principle of least privilege is respected. Wait for explicit approval before generating permission sets.
permissionsetextension for standard BC roles if needed (Pattern 3)al_build — verify no errorsTestPermissions = Restrictive on test codeunitsInclude in the extension's documentation or architecture file:
D (Delete) on setup/configuration tables unless explicitly justifiedAssignable = true on intermediate/base layers (only leaf-level sets)skill-debug.md for investigationWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
permission-sets, least-privilege, security-model, al-language
25 skills in this plugin
/al-buildBuild, package, and deploy AL extensions to Business Central environments. ALDC workflow (Copilot prompt al-build); invoke explicitly./al-context-createGenerate or update context.md file documenting project structure, architecture, and key patterns for AI assistants and developers. ALDC workflow (Copilot prompt al-context.create); invoke explicitly./al-initializeInitialize AL development environment and workspace for Business Central. ALDC workflow (Copilot prompt al-initialize); invoke explicitly.npx claudepluginhub javiarmesto/aldc-al-development-collection --plugin aldcOther plugins' skills for the same job