Filed Level Security using Security Privileges
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.
- Name
- Class
- Age
- 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.
- With No Access, Age & Fee fields will not visible to User
- With reading Access User can't Edit the Age and Fee Fields
- 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 Read Rights
Now Open the Form and verify your customization. kindly check the below screenshot.