Dynamics 365 Business Central: InherentPermissions attribute is now available in the scope “Cloud”

Dynamics 365 Business Central

Hi, Readers.
Today I would like to briefly talk about InherentPermissions attribute in Business Central.
First of all, what is InherentPermissions attribute??? Let’s take a look at MS Docs.

InherentPermissions Attribute: Specifies the permissions assigned to the scope of the method.

Applies To:

  • Method
  • Event

Arguments:

PermissionObjectType
 Type: PermissionObjectType
Specifies the type of object that the attribute assigns permissions to.

ObjectId
 Type: Integer
Specifies the ID of the object that permissions are assigned to. You can specify the object by its ID (integer) or by its name using the syntax <ObjectType>::<ObjectName>, such as Codeunit::MyCodeunit. It is recommended to specify the object by name for readability.

Permissions
 Type: Text
Specifies the permission values. You can specify the permissions using the syntax ”.

[Optional] InherentPermissionsScope
 Type: InherentPermissionsScope
Specifies the scope of the permissions that are assigned (Entitlements, Permissions or Both).

And it was also introduced in detail in Business Central Launch Event Release wave 1 2022.
More details:

There were some limitations at that time.

Only for the scope OnPrem:
The application object or method ‘InherentPermissions’ has scope ‘OnPrem’ and cannot be used for ‘Extension’ development.

Limited to the same extension:
An application object ‘Table 17’ could not be found in the extension.

In the last week, one limitation was lifted.
InherentPermissions attribute is now available in the scope “Cloud” when using 9.2 as runtime version in the app.json of the extension.

This is mentioned in the AL Language Changelog Version 9.4:

But as of today (2022/08/15) there is no update in MS Docs. More details: InherentPermissions Attribute

Let me do a simple test. Set “target”: “Cloud” and “runtime”: “9.2” in app.json file.

PS: If you cannot set the “runtime” to 9.2, please upgrade AL Language extension to v9.4 first.

Then we can set InherentPermissions attribute for the method.

But please note that the limitation of Limited to the same extension has not been lifted. We can only set objects in the same extension.

I think this feature would work very well if this wasn’t limited to just one extension and could add objects in other extensions, I hope Microsoft will add support in future updates. Give it a try!!!😁

END

Hope this will help.

Thanks for reading.

ZHU

コメント

タイトルとURLをコピーしました