How to create ACL to restrict visibility of a field so that some users and groups can view this field

Nikita40
Tera Contributor

I want to create an ACL for cmdb_ci_server table so that for a field, for which I need to restrict visibility so some users and groups will be able to see that field. So How can I create script in ACL to add this users and groups ?

Thanks in advance.

1 ACCEPTED SOLUTION

Hi,

So it should be shown when logged in user is member of CAB Approval or that logged in user is present in list of sys_ids in that system property

Is that system property holding multiple user sys_ids with comma separation

then update as this

answer=false;

if(gs.getUser().isMemberOf('CAB Approval') || gs.getProperty('cmdb_ci_server.os.user.visibility').indexOf(gs.getUserID()) > -1 )
{
answer=true;
}
else{
answer=false;
}

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

25 REPLIES 25

Hi,

this field level WRITE ACL is for editing the field either list or form view.

That has no relation with the field visibility.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi,

Thank you for your help. I was facing issue due to some other configurations but that has been resolved by using debug security.

Thank you again.

Regards,

Nikita

Glad to help.

Please mark appropriate response helpful as well.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

Can we restrict ACL domain wise? And if yes then how can we do this?

Regards,

Nikita

Hi,

I don't think so you can domain separate ACLs

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader