Remove Admin role to view records/fields on specific table

DChandlerKy
Tera Guru

We have built an application per a requirement.   The form and notifications, while simple, work like a charm.   There is no workflow.   The last piece is for us to adjust the ACL's so that only users with a specific role (created when the app/table was created) can view the records. (Yes - everyone is aware that if there is an issue, we will have to add Admin back into the ACL to troubleshoot.)

 

This new table/app was extended off of Task.   I created a Read ACL for each of the fields on the table/form with the specific role and unchecked the "Admin Override" box.   However, I can still see the fields.   A few of the fields are borrowed from the task table, and a few others were created on the new table.

 

Any ideas/suggestions on how to 'lock' Admins out?

 

Thanks,

Diana

1 ACCEPTED SOLUTION

Michael Fry1
Kilo Patron

Tho I personally don't support something like this, you can add this script to the ACL read and it should hide the field from the admin:



var answer = true;


if (gs.hasRole('admin'))


  answer = false;


View solution in original post

5 REPLIES 5

Michael Fry1
Kilo Patron

Tho I personally don't support something like this, you can add this script to the ACL read and it should hide the field from the admin:



var answer = true;


if (gs.hasRole('admin'))


  answer = false;


sumeet_n
Kilo Guru

Hello Diana,



I found it so straight initially. In addition to unchecking the 'admin overrides' checkbox, i had to add the below script to each of the 4 (read, write, delete, create) acls (<tablename.none>) for that table to get it to work.



if(gs.getUser().hasRole('admin')){


false;


}else


true;



In the required roles add that specific role in each acl.




This restricts admin users to access the records, and allows access to users with the specified role to.



Let me know if it works.


Aaviii
Tera Contributor

Hi am getting the below error after adding the code.

IMG_3683.jpeg

Ashok10
Mega Expert

Diana,


I too faced similar kind of problem earlier .Even after unchecking 'admin overrides' check box, admin was able to bypass that ACL.


And when I put   that condition in form of script it started working as expected.



var answer = true;


if (gs.hasRole('admin'))


  answer = false;



Hope this helps.