Field Level Security Dynamics AX 2012 & D365FO




Filed Level Security using Security Privileges 


Field level security always remained a challenge while implementing the Dynamics either it is AX-2012 or Dynamics 365 finance & operations.

So in this article, I have tried to implement field-level security for demonstration purposes.

In this demo, we will explore Read, Write and No Access on Fields.

Step-1  Create Student Table with following Fields.
  1. Name
  2. Class
  3. Age
  4. Fee



Important
We will use Age & Fee Fields to implement Read, Write and No Access Security base on the User role rest of the fields will remain the same delete behavior.

  1. With No Access, Age & Fee fields will not visible to User
  2. With reading Access User can't Edit the Age and Fee Fields 
  3. With Write Access User can change the Age and Fee Fields


Step-2 Create a Simple List page and Add Student Table in the data source.. in the demo our form name is StudentSimpleListPage


Step-3  Create 3 Display Menu Items all will reference to StudentSimpleListPage

  • SL_Student_Read
  • SL_Student_write
  • SL_Student_NoAccess


Step-4 Create 3 Security Privilege and Add Menu Items and Table
  • StudentNoAccess
  • StudentWriteRights
  • StudentReadRights 


  • StudentNoAccess

    • Add SL_Student_NoAccess Display Menu Item and set the Effective Access > Delete Level
    • Add Table Student and set the Effective Access > Delete Level.
    • Example screenshots are below.




    • Now Add All Fields and set the Effective Access to  Update Level on Name and class Fields and set Effective Access to No Access on Age and Fee filed.
    • Example screenshots are below.



  • StudentWriteRights

    • Add SL_Student_write Display Menu Item and set the Effective Access > Delete Level
    • Add Table Student and set the Effective Access > Delete Level.
    • Example screenshots are below.






    • Now Add All Fields and set the Effective Access to  Update Level to All Fields 
    • Example screenshots are below.



  • StudentReadRights 
    • Add SL_Student_Read Display Menu Item and set the Effective Access > Delete Level
    • Add Table Student and set the Effective Access > Delete Level.
    • Example screenshots are below.

    • Now Add All Fields and set the Effective Access to  Update Level on Name and class Fields and set Effective Access to Read Level on Age and Fee filed.
    • Example screenshots are below.


Step-4 Create 3 Security Roles with the below names and add security privilege to them accordingly

  • StudentWriteRights  (Role)
    • StudentWriteRights   (privilege)
  • StudentReadRights   (Role)
    • StudentReadRights    (privilege)
  • StudentNoAccess     (Role)
    • StudentNoAccess      (privilege)
Now it's time for verification, Required Customization is completed just compile the entire project.

Step-5  Verifications
Go To the Systems Administration and assign security StudentNoAccess role.




 Now Open The Dynamics AX with the user you assigned Security Role. You will find the Menu Item in Procurement And Sourcing Module. Menu Name is Student No Access




Now Open the Form and verify your customization. kindly check the below screenshot.




Go To the Systems Administration and assign security StudentReadRights role



 Now Open The Dynamics AX with the user you assigned Security Role. You will find the Menu Item in Procurement And Sourcing Module. Menu Name is Student Read Rights



Now Open the Form and verify your customization. kindly check the below screenshot.





You can download the Complete Demo XPO from the link

No comments:

Post a Comment

Virtual Fields Vs Computed Fields

  Virtual Field: A virtual field in D365FO is a field that doesn't have a direct representation in the database. It's a field that y...