ACLs or before-query business rules that restrict the display of records by field content

N_Y_1014
Tera Contributor

Thanks for your help.

 

I am trying to create an ACL or before query business rule that restricts the display of a record to a user based on the content of an entry in the record for the user.

 

To display a record if the value of a field referencing a department table and the department to which the logged in user belongs are the same.

 

Also, which approach would work to prevent the record from being displayed if the value of the field referencing the department table and the department the logged in user belongs to are different.

 

I have tried to accomplish that with ACLs, but it did not work.
Should I use before query business rules?

 

I would appreciate any advice, even if it is just a simple example.

 

Thank you in advance.

1 REPLY 1

Weird
Mega Sage

Query rules basically limit records from the query while ACL's block visibility.
You probably have an ACL that gives read access to the record and then tried to create another.
Even if the second ACL doesn't give read access the first one would and the user could still see the record. Both ACL's would have to restrict access for that to work.
For example you'd need to add the condition to block visibility if the department doesn't match to the first ACL as well.

For query rule you can just add the condition that the reference fields department must be the users department and it will work. Of course you'll have to be careful with those. Query rules are very effective and if you have users who should have access to these records even without the department, you potentially have to create a lot of different if conditions for your query.