logo

NJP

105. Field Level ACLs

Import · Jun 09, 2024 · article

Tired of writing hundreds of field-level ACLs on a table to control access?

Here is the solution: By using the special variable root_rule we can achieve this. root_rule stores all field names as values which you can use for building conditions as per your need.

Step 1. Write only one table.* ACL.

Step 2. Use the special variable “root_rule” to access all the fields from that table in ACL Script. Sample below.

Var columnName = root_rule.split(‘.’)[1]; //root_rule automatically picks up all the columns from the current ACL as tableName.columnName

Step 3. Now, use the columnName variable defined in Step 2 to control the access like below.

If(columnName.indexOf(‘’)) answer = false;

Else answer = true;

View original source

https://medium.com/@LearnITbyPrashant/105-field-level-acls-5d4744ed4a33?source=rss-d005fc598f0a------2