Members of the group can edit assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2024 06:54 AM
Members of the group can edit assignment group field in Incident form and who are not members of the group find the assignment group field read only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2024 07:10 AM
Hi @shid077 ,
You can write a OnLoad() Client Script on table :-
var fields = g_form.getEditableFields();
for (var x = 0; x < fields.length; x++) {
if(!gs.getUser.isMemberOf('sys_id_of_assignment_group')){
g_form.setReadOnly(fields[x], true);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2024 07:40 AM
Hi @shid077 ,
Though this can be achieved using read ACLs, but it may force restricted users to get access through other read ACLs or OOB readACLs on that table.
Since it is not suggested to disable other ACLs, we can restrict incidents of specific group from visibility via before-query business rule
- Create a Before -Query Business rule on 'Incident' table
- In the Advanced tab, set the condition as:
!gs.getUser().isMemberOf('<group name to be restricted for other users>')
In script add below code -
(function executeRule(current, previous /*null when async*/ ) { var grp = current.addNullQuery('assignment_group').addOrCondition('assignment_group','!=','<sys_id of the group to be restricted for other users>'); })(current, previous);
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda