I got an internal question from our consultants on how they are able to access the license information of the customer for an OnPrem customer. There are a few scenarios where that’s interesting. Just to check which license is in production. Or how many objects or users did they buy. Well – anything license wise ;-).
With the refactoring done in Dynamics 365 Business Central for better supporting the SaaS environment, is not quite easy to check if a user has a specific permission on a specific object.
Permission Range table is now a system table that cannot be used on a SaaS environment, License Permission table does not give you specific user permissions and using the ReadPermission and WritePermission methods (that can determine if a user has read and write permission on the object) is only available for table objects and often this is not enough if you have complex security checks to implement (for example if you want to test if your user has execute permissions on a specific codeunit).
An interesting question pops out yesterday: with Dynamics 365 Business Central on-premise, how can I programmatically check if a particular extension is installed or not?
The standard Powershell command (in the Microsoft.Dynamics.Nav.Apps.Management module) that gets informations about an extension in a specified Business Central Server instance is the Get-NAVAppInfo cmdlet (more info about it here).