0

I want to disable the security policy for some forms. It is better to disable security policy when user clicks on the menu item. Otherwise we should consider all lookup and fields which I think it is not a good approach. i.e. We should use uncheck::XDS in every method required. One solution is linking each display menu item to action menu item. In the main method of the action menu item we disable the security policy then run the related display menu item.

public static class ActionMenuItem
{
    static void main (Args _args)
    {
        unchecked(Uncheck::XDS)
        {

            MenuFunction mf;
            mf= new MenuFunction(menuItemDisplayStr(myDisplayMenuItem), MenuItemType::Display);
            mf.run(_args);
            mf.wait();
        }
    }
}

Actually, I think the above approach is not best practice, I should modify each display menu item and create a class multiple times. I am searching for the better solution which are more efficient.

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
Nastaran Hakimi
  • 695
  • 1
  • 16
  • 36
  • Could you describe the business scenario behind this requirement and how the security policy was designed? – FH-Inway Apr 06 '20 at 13:54
  • @FH-Inway we have different security policies. For example user can only see vendors with the buyer group which is defined for them. But also we have some inquiry reports which we want to user be able to see the all vendors. because it is a report. security policy object used the role is assigned there. each user with that role able to see restricted records. – Nastaran Hakimi Apr 06 '20 at 16:36
  • Same question in the D365 SCM community forum: https://community.dynamics.com/365/supply-chain-management/f/dynamics-365-supply-chain-management-forum/385351/how-to-disable-security-policy-for-bunch-of-inquiry-reports – FH-Inway Apr 07 '20 at 19:59
  • @FH-Inway it is me . Should I delete my question here? – Nastaran Hakimi Apr 08 '20 at 06:09
  • 1
    That is your decision. To help others with a similar question, you could review your question here and add an answer based on the answer you received and your experience implementing it. – FH-Inway Apr 08 '20 at 10:04

0 Answers0