How to make fields read only if logged in user is not part of assignment group in CI

raj149
Giga Guru

Hello Experts,

In user table there is one field called cmdb this field type is select box as per now if logged in user cmdb=true then he can able to edit all the fields in all ci classes. if cmdb=false then he cannot edit all field will be read only.

 

now the requirement is

 

In any CI classes current logged in user is a part of support group and he is not part of assignment group and cmdb=true then we need make read only  2 fields (status and support group)

remaining fields need to be editable because cmdb=true.

 

note.

above change will not applicable for Admins and config admin roles

 

How to achieve this instead of ACLs.

 

Best Regards,

Raj.

 

11 REPLIES 11

Ankur Bawiskar
Tera Patron
Tera Patron

@raj149 

I will recommend using ACL.

Why not to use ACL?

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

Hello @Ankur Bawiskar 

 

we need to write a lot of ACLs for all the tables.

already a lot of ACLs running on CI tables.

 

Currently in the requirement they mentioned only 2 fields but in future they will come with more fields .

 

 

Best Regards,

Raj.

 

@raj149 

then you can use onLoad client script on parent cmdb_ci and use inherit checkbox.

then check the onLoad is running on which class and then use GlideAjax to check if user belongs to that group

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

Hello @Ankur Bawiskar 

 

I am new to scripting .

Could you please post the script that will helpful for me.

 

Best Regards, 

Raj.