Restricting record visibility in contract table?

karishma shaik
Tera Contributor

HI All,

 

I have a requirement, In contract  table for example 5 users have access to that table.  If two users raise the contract request other 3 users can't able to see there records. We need to block all ways to restrict there records. Please help me on this.

 

Thanks,

Karishma

3 REPLIES 3

OlaN
Giga Sage
Giga Sage

Hi,

Your question is a bit confusing, could you elaborate a bit more?

In general, if all 5 users have access to the table, and all the records within, you cannot create additional access controls that restrict access to a subset of these records, because access is already granted.

Anand Kumar P
Giga Patron
Giga Patron

Hi @karishma shaik ,

You can create new read acl on table level for contract table with below script

 

if(gs.getUserID() == current.sys_created_by){
answer = true;
}else{
answer=false;
}

 

or you can create before query business rule on contract table

 

(function executeRule(current, previous /*null when async*/ ) {

 current.addQuery('sys_created_by', gs.getUserID());

})(current, previous);

1. Performance: Before query is better because the conditions/filters run the initial Database query level.

2. User Experience: Before Query is better because you don't get the security message in the bottom of the ListView saying 'some records removed due to security" which might confuse the user.

Though ACL has its own advantages (for example - field level restriction..etc)

 

Please mark it as solution proposed and helpful if its serves your purpose.

Thanks,

Anand

Venkatesh_N
Tera Guru

Hello @karishma shaik ,

Write a query Business rule on the contract table and return a query like below :

 

current.addQuery('created_by', gs.getUserID());

 

 

So that, records that records created by current logged in user will only be shown.

 

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks,
Venkatesh Nekkanti