Duplicated Permissions Sets in Business Central SaaS
Duplicated Permissions Sets in Business Central SaaS
SCENARIO:
Installing an extension with an duplicated permission set
One the requirements to have a Dynamics 365 Business Central extension put on AppSource (or not published on “AppSource” but ready to Production Environment) is “Permission set(s) must be created by your extension and when marked, should give the user all setup and usage abilities”. A user must not be required to have SUPER permissions for setup and usage of your extension”.
Microsoft Community link https://community.dynamics.com/business/f/758/t/267751
Microsoft Suggestion
“Create and after copy the permission set file (the .xml file) into your Visual Studio Code extension folder; the next compile will identify the file as a permission set and include it in the extension package. The installation of the extension will then add the permission set.”
Right but… we could have some problems with duplicate permission set during the installation of a non-certified app (at your own risk as indicated by Microsoft on the app installation page.. obviously it’s a developer problem … not a system problem). In practice, the permission set is loaded with the “Extension ID, Permission SET ID, for Tenant” key, so it is possible that there are more than one equal name for the same tenant that blocks the “Permission set buffer” table …and it’s no more possible to access the management of permits in any traditional way.
PERMISSIONS SETS PAGE
Two Workarounds
#1 With Standard Export\Import Permission Sets Tools (XMLPorts) – export the permissions on XML files, modify the wrong ones removing the duplicates, then re-import the modified xml files that eliminate the error.
#2 With my custom Pages – you can install the two pages (attached below) that allow you to fix the problem without exporting everything. System works on tables table “2000000165” and table “2000000166”
I enclose the two pages below, they could be useful.
Two Objects: _Page Tenant Permission Set_.al and _Page Tenant Permission_.al
https://github.com/rstefanetti/AL-Samples/tree/Change-Permissions-Sets
ERROR SCENARIO
If you have duplicated Permissions Sets Names and you try to open “Permissions Sets” page you can receive this error:
“The record in table Permission Set Buffer already exists”
- In this case we have duplicated permissions sets and BC can’t open the “permission sets” page
SOLUTION
Launch my pages: search for “Extension.. “ in Search page
Launch my pages
- Tenant Permission
- Tenant Permission Set
SEARCH THE DUPLICATED PERMISSION SET FROM PAGE
- Change\Remove the duplicated permission set (Header and Details)
.. and now you can open “Standard Permission Sets” page
NICE POST BY NAV TEAM ABOUT PERMISSIONS SETS
How can partners add permission sets?
https://docs.microsoft.com/en-us/dynamics365/business-central/ui-how-users-permissions
Editable Permission Sets