{"title":"Entitlement object","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-entitlement-object/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-entitlement-object, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-entitlement-object","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Discover how to define and use entitlement objects in AL for Business Central.","date":"2025-03-19","meta":{"topic":"article"},"outline":[{"level":2,"title":"Supporting transactability for Marketplace apps","slug":"supporting-transactability-for-marketplace-apps","at":940,"chars":270},{"level":2,"title":"Snippet support","slug":"snippet-support","at":1210,"chars":416},{"level":2,"title":"Entitlement examples","slug":"entitlement-examples","at":1626,"chars":7003},{"level":3,"title":"Entitlement example - delegated admin","slug":"entitlement-example---delegated-admin","at":2106,"chars":1342},{"level":3,"title":"Entitlement example - per-user plan","slug":"entitlement-example---per-user-plan","at":3448,"chars":527},{"level":3,"title":"Entitlement example - unlicensed","slug":"entitlement-example---unlicensed","at":3975,"chars":3037},{"level":4,"title":"Entitlement example - testing for entitlements in code","slug":"entitlement-example---testing-for-entitlements-in-code","at":4572,"chars":2440},{"level":3,"title":"Entitlement example - Microsoft Entra group","slug":"entitlement-example---microsoft-entra-group","at":7012,"chars":481},{"level":3,"title":"Entitlement example - Microsoft Entra application access","slug":"entitlement-example---microsoft-entra-application-access","at":7493,"chars":1136},{"level":2,"title":"Related information","slug":"related-information","at":8629,"chars":352}],"text":"> APPLIES TO: Business Central 2021 release wave 1 (v18.0) and later\nThe entitlement object in Business Central describes which objects in Business Central a customer is entitled to use according to the license that they purchased or the role that they have in Microsoft Entra ID.\nAn entitlement consists of many devenv-permissionset-object put together to constitute a set of meaningful permissions for a user. An entitlement can only include permission set objects, which reference the objects that are included within the same app. This is to ensure that the entitlements included with one app can't alter or redefine the entitlements included with another app. Being entitled defines the maximum permissions a user is entitled to. Actual permissions are the intersection between the permissions the user is entitled to and the permissions the user is assigned.\nEntitlements can only be used with the online version of Business Central.\n## Supporting transactability for Marketplace apps\nWith Business Central 2023 release wave 2, entitlements support transactability for Marketplace apps by binding entitlements to offers. See Selling Business Central apps through Marketplace<devenv-sell-apps-appsource>.\n## Snippet support\nTyping the shortcut tentitlement creates the basic layout for an entitlement object when using the AL Language extension for Microsoft Dynamics 365 Business Central in Visual Studio Code.\n> TIP\n> Use Ctrl+Space to trigger IntelliSense and get assistance on code completion, parameter info, quick info, and member lists. For more information about snippets, see Syntax and snippets<devenv-syntax>.\n## Entitlement examples\nThe following sections illustrate examples of how to define entitlements in AL. For more inspiration, learn from examples in the System Application BCApps<https://github.com/microsoft/BCApps/tree/main/src/System%20Application/App/Entitlements>.\nLearn about how telemetry data can help you identify problems a user (or a service) might experience when signing in, in Analyzing Authorization Trace Telemetry<../administration/telemetry-authorization-trace>.\n### Entitlement example - delegated admin\nThis example illustrates a simple entitlement object with the properties/devenv-type-property set to Role, which means that the entitlement is associated with a Microsoft Entra role. When Type is set to Role, the properties/devenv-roletype-property distinguishes between local and delegated assignments of the role. In this case, it's Delegated. The properties/devenv-objectentitlements-property defines the list of permissions that the entitlement includes.\n```al\n\nentitlement \"Delegated Admin agent - Partner\"\n{\n    Type = Role;\n    RoleType = Delegated;\n    Id = '00000000-0000-0000-0000-000000000007';\n\n    ObjectEntitlements = MyApp_PartnerFullAccessPermissionSet;\n}\n\nentitlement \"Delegated Helpdesk agent - Partner\"\n{\n    Type = Role;\n    RoleType = Delegated;\n    Id = '00000000-0000-0000-0000-000000000008';\n\n    ObjectEntitlements = MyApp_PartnerFullAccessPermissionSet;\n}\n\nentitlement \"Dynamics 365 Admin - Partner\"\n{\n    Type = Role;\n    RoleType = Delegated;\n    Id = '00000000-0000-0000-0000-000000000009';\n\n    ObjectEntitlements = MyApp_PartnerFullAccessPermissionSet;\n}\n\nentitlement \"Delegated BC Admin agent - Partner\"\n{\n    Type = Role;\n    RoleType = Delegated;\n    Id = '00000000-0000-0000-0000-000000000010';\n\n    ObjectEntitlements = MyApp_PartnerFullAccessPermissionSet;\n}\n```\n### Entitlement example - per-user plan\nAn example of an entitlement where Type is PerUserOfferPlan. This type is used to enable transactability for Marketplace apps. The Id property is used to map the entitlement to the plan in Partner Center, and must contain the Service ID for the plan. See Selling Business Central apps through Marketplace<devenv-sell-apps-appsource>.\n```al\nentitlement BC_PerUserOfferPlan\n{\n    Type = PerUserOfferPlan;\n    Id = 'MyOfferPlan';\n\n    ObjectEntitlements = \"MyOfferLicensePermission\";\n}\n```\n### Entitlement example - unlicensed\nFor scenarios when the user isn't licensed through entitlements mapping to Marketplace offer plans, the Unlicensed type of entitlement is used. This type is used to enable custom licensing for an existing customer, or side-by-side support, for transactability-enabled apps on Marketplace. See Selling Business Central apps through Marketplace<devenv-sell-apps-appsource>.\n```al\nentitlement BC_Unlicensed\n{\n    Type = Unlicensed;\n    ObjectEntitlements = \"Custom license\";\n}\n```\nIn the following code example, you can see how to check for entitlements in code.\n#### Entitlement example - testing for entitlements in code\n```al\npermissionset 50101 MyFreeLicensePermission\n{\n    Assignable = false;\n    Permissions = table MyTable = X,\n                  tabledata MyTable = R;\n}\n\npermissionset 50102 MyOfferLicensePermission\n{\n    Assignable = false;\n    Permissions = tabledata MyTable = RMID;\n    IncludedPermissionSets = \"MyFreeLicensePermission\";\n}\n\nentitlement BC_Unlicensed\n{\n    Type = Unlicensed;\n    ObjectEntitlements = \"MyFreeLicensePermission\";\n}\n\nentitlement BC_PerUserOfferPlan\n{\n    Type = PerUserOfferPlan;\n    Id = 'MyOfferPlan';\n    ObjectEntitlements = \"MyOfferLicensePermission\";\n}\n\n...\nprocedure CheckingForEntitlementsUsingPermissions()\n    var\n        myTable: Record MyTable;\n    begin\n        if myTable.WritePermission() then\n            message('User is entitled and has permission to write to MyTable => user is licensed')\n        else\n            if myTable.ReadPermission() then\n                message('User is entitled and has permission to read from MyTable => user is unlicensed')\n            else\n                Message('User does not have permission to read from MyTable - we do not know if the user is licensed ');\n    end;\n\n    procedure CheckingForMyEntitlements()\n    begin\n        if NavApp.IsUnlicensed() then\n            Message('User is assigned my BC_Unlicensed entitlement')\n        else\n            if NavApp.IsEntitled('BC_PerUserOfferPlan') then\n                Message('User is assigned my BC_PerUserOfferPlan entitlement')\n            else\n                Message('This user is not assigned any of my entitlements, so this code will not run');\n    end;\n\n    procedure CheckingForOtherAppEntitlements()\n    begin\n        if (NavApp.IsEntitled('Delegated Admin agent - Partner', '63ca2fa4-4f03-4f2b-a480-172fef340d3f')) then\n            Message('User is assigned the delegated admin agent entitlement defined in the system app: https://github.com/microsoft/BCApps/blob/main/src/System%20Application/App/Entitlements/DelegatedAdminagentPartner.Entitlement.al')\n        else\n            if (NavApp.IsEntitled('Dynamics 365 Business Central Essentials', '63ca2fa4-4f03-4f2b-a480-172fef340d3f')) then\n                Message('User is assigned the essentials entitlement defined in the system app: https://github.com/microsoft/BCApps/blob/main/src/System%20Application/App/Entitlements/Dynamics365BusinessCentralEssentials.Entitlement.al');\n    end;\n...\n```\n### Entitlement example - Microsoft Entra group\nThis example shows an entitlement where Type is Group. It supports scenarios where a user needs access to the Marketplace app with transact support without buying a developer license. The id property is the object ID of the Microsoft Entra group. See Selling Business Central apps through Marketplace<devenv-sell-apps-appsource>.\n```al\nentitlement BC_Group\n{\n    Type = Group;\n    Id = '1a2aaaaa-3aa4-5aa6-789a-a1234567aaaa';\n}\n\n```\n### Entitlement example - Microsoft Entra application access\nAn example of an entitlement where Type is Application. It supports scenarios when a vendor needs access to the Marketplace app with transact support and no need to buy a license. The id property is the client ID of the Microsoft Entra application. See Selling Business Central apps through Marketplace<devenv-sell-apps-appsource>.\n```al\nentitlement BC_SpecificApplication\n{\n    Type = Application;\n    Id = '1a2aaaaa-3aa4-5aa6-789a-a1234567aaaa';\n}\n```\nAn example of an entitlement where Type is ApplicationScope. It supports scenarios when Microsoft Entra application access to the Marketplace app with transact support is needed and no license is required. The id property is the scope assigned to the Microsoft Entra application. See Using Service-to-Service (S2S) Authentication<../administration/automation-apis-using-s2s-authentication>.\n```al\nentitlement BC_ApplicationWithAPIRWScope\n{\n    Type = ApplicationScope;\n    Id = 'API.ReadWrite.All';\n}\nentitlement BC_ApplicationWithAutomationScope\n{\n    Type = ApplicationScope;\n    Id = 'Automation.ReadWrite.All';\n}\n```\n## Related information\nDeveloping extensions<devenv-dev-overview>\nAL development environment<devenv-reference-overview>\nEntitlements and permission set overview<devenv-entitlements-and-permissionsets-overview>\nPermission set extension object<devenv-permissionset-ext-object>\nSelling Business Central apps through Marketplace<devenv-sell-apps-appsource>"}