Package least-privilege access with AL objects

Completed

The extension's first security decision is how to package access that administrators can understand and assign. You start with the minimum object operations for each feature, then compose those operations into roles without treating the role as the user's complete effective access.

Separate entitlement from assignment

An entitlement describes the maximum set of online objects that a user can access through a supported identity or commercial relationship. Its source can be a Business Central license, a Microsoft Entra role, a Marketplace offer plan, an app scope, or another supported entitlement type. ObjectEntitlements identifies permission sets whose permissions reference objects in the same app. Entitlement objects can therefore bind supported identities or offers to app-owned object access.

The entitlement isn't an administrative role assignment. Business Central evaluates the entitlement boundary together with permission sets assigned to the user. Actual access is the intersection of what the entitlement permits and what the applicable assignment grants. If either side omits a required object or operation, access fails. Assigning a broader permission set doesn't independently expand the entitlement.

A Marketplace entitlement needs an approved Partner Center service ID and the corresponding offer configuration. Don't invent an ID to make an example compile. The following fragment is illustrative rather than deployable and shows only the relationship you model after receiving an approved identity:

// Illustrative only: use an approved Partner Center service ID in a real entitlement.
// Type = PerUserOfferPlan;
// Id = '<approved Partner Center service ID>';
// ObjectEntitlements = "APP FEATURE USER";

This same-app boundary prevents one app's entitlement from redefining the objects supplied by another app. It also gives you a useful design rule: model commercial eligibility separately from the permissions that an administrator assigns for a job.

Compose permission sets by responsibility

An AL System permission set ships with an app and is defined in source. A user-defined permission set is an editable tenant configuration that an administrator creates or copies in Business Central. Keep this distinction clear during support: a developer changes an AL object and republishes the app, while an administrator changes tenant assignments or a user-defined set.

A permission set object can be assignable or nonassignable. Assignable sets appear as roles that administrators assign directly on Users or through security groups. An assignment can apply to all companies or to one company. Assignable permission set object names have a 20-character limit. Nonassignable sets work well as reusable building blocks that group the smallest permissions for a feature.

The Permissions property declares object operations. The uppercase letters RIMDX grant direct read, insert, modify, delete, and execute permissions. Lowercase rimdx grant indirect permissions. Direct permission overrides indirect permission when composed results contain both. Indirect table-data access doesn't authorize arbitrary access to that table. It works only through a related object or code path that has the required permission and performs the operation.

The IncludedPermissionSets property composes reusable sets into a role. The following pattern keeps data and object access in a nonassignable component, while the assignable role remains easy to recognize:

permissionset 70600 "APP FEATURE DATA"
{
    Assignable = false;

    Permissions =
        table "Feature Buffer" = X,
        tabledata "Feature Buffer" = R,
        page "Feature Entries" = X;
}

permissionset 70601 "APP FEATURE USER"
{
    Assignable = true;

    IncludedPermissionSets = "APP FEATURE DATA";
}

For permission set objects, ExcludedPermissionSets can remove an included set from a composed permission set when that composition requires an exception. It doesn't remove individual permissions, and it isn't supported on permission set extension objects. Prefer positive, understandable composition over a long chain of inclusions and exclusions.

Assess additive extension risk

A permission set extension adds permissions to an existing AL System permission set. It can't remove permissions. Installation activates those additions for every user who already has the extended set, including assignments made through security groups and company-specific assignments where the set applies. This behavior makes extension review part of authorization design rather than a packaging detail.

Add permissions only to objects owned by the extension when possible. Extending a common role with broad base-application data permissions can elevate a large population as soon as the app is installed. Before you publish, identify who holds the target set, which companies the assignments cover, and whether each added operation supports the role's existing purpose.

permissionsetextension 70602 "APP FEATURE ACTION" extends "APP FEATURE USER"
{
    Permissions =
        codeunit "Feature Service" = X;
}

Use an additive extension when the new app-owned object logically completes the existing role for all assignees. Use a separate assignable permission set when administrators need to opt users in, scope the assignment differently, or separate duties. In either design, test with a representative nonadministrator and inspect the composed result instead of assuming the source object is the complete effective permission.

For more information, see Permission set object, Permission Set Extension Object, and Entitlements and permission sets overview.