How to make fields read only if logged in user is not part of assignment group in CI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2023 12:27 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2023 01:11 AM
I will recommend using ACL.
Why not to use ACL?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2023 01:28 AM - edited 03-14-2023 01:32 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2023 01:31 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2023 01:51 AM
Hello @Ankur Bawiskar
I am new to scripting .
Could you please post the script that will helpful for me.
Best Regards,
Raj.