Make assignment group and assigned to fields editable only to admin and incident manager.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â11-14-2021 11:33 PM
Hi everyone,
I want to Make assignment group and assigned to fields editable only to admin and incident manager. For others these fields should be readonly
I have written onload client script
function onLoad(){
if(!g_user.hasRoleExactly('admin') || !g_user.hasRoleExactly('incident_manager')){
g_form.setReadOnly('assignment_group', true);
g_form.setReadOnly('assigned_to', true);
}
}
but its not working , can anyone help me with this?
Thanks
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â11-14-2021 11:38 PM
Hi,
If this is for security purposes, an ACL should be used to prevent write access as a client script will only change the UI, but can be worked around.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â11-14-2021 11:38 PM
Since you are using ! operation you should use &&
function onLoad(){
if(!g_user.hasRoleExactly('admin') && !g_user.hasRoleExactly('incident_manager')){
g_form.setReadOnly('assignment_group', true);
g_form.setReadOnly('assigned_to', true);
}
}
Palani

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â11-14-2021 11:40 PM
Better approach would be ACL to implement this.
You can create a write ACL and can provide the role incident manger in the role and check the admin override.
If you do not have any other ACL then for same thing then it should work.
Hope it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â11-15-2021 12:32 AM
Can you please help me with this in detail