Share via


Microsoft Dynamics AX 2012 Security Policies Extensible Data Security (XDS)- Create Security Policy

In a aprevious article we have covered stage one of Extensible Date Security - Policy query.

In this article we will cover the second, final stage of Extensible Data Security that is Security Policy.

Security policies enable developers and administrators to block access to subsets of data rows in tables. A policy is roughly similar to a where clause in an SQL select statement. A security permission increases the access a user has to data, but a security policy decreases access to data.

Follow are the steps to create the security policy:

  1. In the AOT, expand the Security node.

https://community.dynamics.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-09-91/3755.1.jpg

  1. Right-click the Policies node and select New Security Policy.

https://community.dynamics.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-09-91/0247.2.jpg

  1. In the property sheet for the security policy, set the Name property to SmmBusRelUser
    1. Set the Label property to Limit Prospects by User.
    2. Set the Primary Table property to HcmWorker.
    3. Set the Query property to HcmSalesUser.
    4. Set the ContextType property to RoleName.
    5. Set the RoleName property to TradeSalesRepresentative.
    6. Finally set the Enabled property to Yes.

https://community.dynamics.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-09-91/8407.3.jpg

  1. Expand the SmmBusRelUser security policy.

https://community.dynamics.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-09-91/1715.4.jpg

  1. Right-click the Constrained Tables node and select New > Add table by relation.

https://community.dynamics.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-09-91/5226.5.jpg

  1. In the property sheet for the new constrained table set following properties:
      1. Set the Table property to smmBusRelTable.
      2. Set the TableRelation property to MainContactWorker.
      3. Save your changes to the policy.

https://community.dynamics.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-09-91/4578.6.jpg

Follow the instruction bellow to test the security policy.

  1. Log on to Microsoft Dynamics AX as User. To do this, right-click the short-cut, while holding the Shift key down, and select Run as Different User.
  2. Enter  the user and enter the password.
  3. Open Sales and Marketing > Prospects > All prospects.
  4. Only prospects with User set as the sales rep will display.