{"title":"Export permission sets to XML","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-export-permission-sets/","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-export-permission-sets, 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-export-permission-sets","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":"Learn more about exporting permission sets to XML in Business Central.","date":"2025-01-10","meta":{"topic":"how-to"},"outline":[{"level":1,"title":"Export permission sets to XML","slug":"export-permission-sets-to-xml","at":0,"chars":3889},{"level":2,"title":"To export permission sets from Business Central","slug":"to-export-permission-sets-from-business-central","at":705,"chars":609},{"level":2,"title":"To export permission sets using Visual Studio Code","slug":"to-export-permission-sets-using-visual-studio-code","at":1314,"chars":2341},{"level":3,"title":"Example from Visual Studio Code","slug":"example-from-visual-studio-code","at":1893,"chars":1420},{"level":3,"title":"Object type mapping","slug":"object-type-mapping","at":3313,"chars":342},{"level":2,"title":"Related information","slug":"related-information","at":3655,"chars":234}],"text":"# Export permission sets to XML\nPermission sets that exist in Business Central can be exported and packaged for your extension directly from the client, instead of defining XML by hand. These permission sets are also known as tenant permissions, and are shown in the UI as Extension permissions. The underlying functionality of permissions has changed with the latest version of Business Central.\n> IMPORTANT\n> With the latest version of Business Central permissions are no longer defined as data in the application database. Permissions that can be created by using AL objects are called system permissions. See Entitlements and permission sets overview<devenv-entitlements-and-permissionsets-overview>.\n## To export permission sets from Business Central\n1. In Business Central, search for Permission Sets, and then choose the relevant link.\n2. On the Permission Sets page, choose the permissions that you want to export, and then choose Export Permission Sets.\n3. Save the file to your extension folder.\n4. Delete the permission sets from Business Central.\nYou can generate a permission set file which contains permissions to all the files in your extension. This makes it easier to start setting up permissions for your app. You can do this by simply creating an extension with some objects as described below.\n## To export permission sets using Visual Studio Code\n1. In Visual Studio Code, open your extension with objects; pages, reports, tables, queries, codeunits, and/or XMLports.\n2. Open the command palette using the `Ctrl+Shift+P` keys and select the AL: Generate permission set as XML file containing current extension objects command.\n> NOTE\n> If you do this repeatedly, Visual Studio Code will probe for overwriting the file, there's no support for merging manual corrections into newly generated content.\nNow, you have the XML file with default permissions to all your objects.\n### Example from Visual Studio Code\nThe following example illustrates the generated .xml file from MyProject which contains a table with objectID 50106 and two object types are generated; `<ObjectType>0</ObjectType>` is TableData and `<ObjectType>1</ObjectType>` is Table.\n> NOTE\n> The maximum length of the RoleID attribute is 20 characters. If the RoleID exceeds this length, then the XML schema validation fails and the corresponding permission set file is not included in the resulting app package. You will get a warning in the Visual Studio output panel.\n```xml\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<PermissionSets>\n  <PermissionSet RoleID=\"MyProject\" RoleName=\"MyProject\">\n    <Permission>\n      <ObjectID>50106</ObjectID>\n      <ObjectType>0</ObjectType>\n      <ReadPermission>1</ReadPermission>\n      <InsertPermission>1</InsertPermission>\n      <ModifyPermission>1</ModifyPermission>\n      <DeletePermission>1</DeletePermission>\n      <ExecutePermission>0</ExecutePermission>\n      <SecurityFilter />\n    </Permission>\n    <Permission>\n      <ObjectID>50106</ObjectID>\n      <ObjectType>1</ObjectType>\n      <ReadPermission>0</ReadPermission>\n      <InsertPermission>0</InsertPermission>\n      <ModifyPermission>0</ModifyPermission>\n      <DeletePermission>0</DeletePermission>\n      <ExecutePermission>1</ExecutePermission>\n      <SecurityFilter />\n    </Permission>\n</PermissionSet>\n</PermissionSets>\n\n```\n### Object type mapping\nThe mapping of object types in the XML such as `<ObjectType>0</ObjectType>` generated from Visual Studio Code is the following:\nObject type|Number\nTableData|0\nTable|1\nReport|3\nCodeunit|5\nXMLPort|6\nPage|8\nQuery|9\nFieldNumber|11\nPageExtension|14\nTableExtension|15\nEnum|16\nEnumExtension|17\nProfile|18\nProfileExtension|19\n## Related information\nEntitlements and permission sets overview<devenv-entitlements-and-permissionsets-overview>\ndevenv-permissions-on-database-objects\nproperties/devenv-permissions-property\nproperties/devenv-testpermissions-property"}