- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 07:01 AM
How to Hide "+" (Add Relationship)icon in related items (Legacy CI Relations) cmdb_ci table for certain users(roles)
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 10:38 AM
You need to allow DOM manipulation for your client script.
Please add "Isolate script" flag in client script form layout and make sure it's unchecked like below
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 07:16 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 07:38 AM
1) you can Adjust the 'Create' ACL on the 'cmdb_rel_ci' (CI Relationship) table so that it requires specific roles. they can't create records on cmdb_rel_ci table, ...BUT it's a bad user experience because they see the icon and believe they can.
2) If you still want to remove that button and retain access for restricted users to actually edit the CI record, you could set up an 'onLoad' client script on the 'cmdb_ci' table with the 'Inherited' checkbox checked (so that it applies to the entire CMDB). That client script would need to include code like this...
// Hide the 'Add' icon on the relationship editor unless the user has the 'asset' role
if (!g_user.hasRole('asset')) {
$('add_relationship').hide();
}
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 08:23 AM
I have written an onLoad Client script but no luck, I'm able to see for other roles as well
if (!g_user.hasRole('ecmdb_admin')) {
$('add_relationship').hide();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 09:48 AM
I'm trying for "Legacy CI relations" , with below code
function onLoad() {
//Type appropriate comment here, and begin script belowgs.
if (!g_user.hasRole('asset')) {
$('addrelation').hide();
}
}
it is not working can you please let me know how can I achieve this