Search code examples
axaptax++dynamics-ax-2012

Are permissions checked for running action menu item or opening display menu item with MenuFunction?


I have a method which calls different MenuItems, depending on parameters:

e.g.

new MenuFunction(menuitemActionStr(MenuItemToCall), MenuItemType::Action).run(args);

Will it be automatically checked if the current user has permissions to open/run the various menu items? If not, how can I check by code the privileges of the user/ the needed permissions of the menu item?


Solution

  • 1) Yes, it will be automatically checked whether the current user has permissions to open/run menu items.

    2) You can use following methods from the Global class:

    • boolean hasMenuItemAccess(MenuName name, MenuItemType type)

    • boolean hasMenuItemSecurityAccess(MenuFunction _menu)