Exporting Permission Sets
Permission sets that exist in Dynamics 365 Business Central can be exported and packaged for your extension directly from the client, instead of defining XML by hand.
To export permission sets from Dynamics 365 Business Central
- In Dynamics 365 Business Central, search for Permission Sets, and then choose the relevant link.
- On the Permission Sets page, choose the permissions that you want to export, and then choose Export Selected Permissions.
- In the Export Permission Sets dialog, choose to export permission sets only for the application, only for the tenant, or for both.
- Save the file to your extension folder.
- Delete the permission sets from Dynamics 365 Business Central.
You can generate a permission set file which contains permissions to all the files in your extension. This will make it easier to start setting up permissions for your app. You can do this by simply creating an extension with some objects.
To export permission sets using Visual Studio Code
- In Visual Studio Code, open your extension.
- Create extension with some objects like Page, Report, Table, Query, Codeunit, or XmlPort.
- Open the command palette using the
Ctrl+Shift+Pkeys and select the AL: Generate permission set containing current extension objects command.
If you do this repeatedly, Visual Studio Code will probe for overwriting the file, there is no support for merging manual corrections into newly generated content.
- Publish the app.
Now, you have the XML file with default permissions to all your objects.