Compartir a través de


Walkthrough: Creating a Role Context Security Policy

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

In this topic you modify a policy to apply it to security roles.

Prerequisites

This topic continues a sequence of topics. This topic uses AOT elements that you create by completing the preceding topics. For this topic, you first must complete the preceding topics listed next:

  1. In Walkthrough: Creating a Simple Default Security Policy you created and verified a simple default security policy.

  2. Then in Walkthrough: Constraining Access to Table Data by Using Security Policies you constrained tables or views by enforcing a security policy on related tables.

Change the Security Policy to Specify a Security Role

  1. Change the ContextType property on the policy node MajorCustomersPolicy to RoleName.

  2. Set the RoleName property on the policy node to TradeSalesManager.

    The following figure shows the MajorCustomersPolicy security policy property values.

    AOTSecurityPolicyRole

    The security policy property values

Verify that the Security Policy is Enforced

As an application user, you can now verify that the new security policy is enforced by the system.

  1. Manually assign an application user to the Sales manager role by using the System administration form. For information about how to assign a user to a role, see Assign users to security roles.

  2. Log on to the system as an application user and run the AX32.exe client application from the Command Prompt window.

  3. Switch to company Contoso Entertainment Systems (West) (CEU).

  4. Switch to module Accounts Receivable and open Setup > Customers > Customer groups

  5. Verify that the application user can only view the Major customers customer group, as shown in the following image.

    AOTSecurityPolicyOutput

    The customer group that the application user can view

See also

Security Policies Properties

Walkthrough: Constraining Access to Table Data by Using Security Policies

Walkthrough: Creating a Role Context Security Policy

Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.