- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 06:12 AM
Hi,
I have a requirement where a field in a table is to be editable by users with certain roles. What would be the best practice and approach? Kindly help.
Regards
Suman P.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 06:54 AM
Delete the script (because the script will remain active, as long as the field has a value) and just add the roles to the 'roles' section within the condition. You don't need to script for roles in ACL's.
And for this one: you could just add the 'cmdb_admin' role and tick 'admin override' on the ACL.
This will work, assuming the roles grant sufficient access to the table as well.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 06:37 AM
Create a write ACL for just this field. If a user without such a role opens the record, it won't be editable, because of that field ACL.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 06:43 AM
Hi @Mark Manders,
I have used the ACL, can you please validate and correct if wrong.
answer = false;
if(gs.getUser().hasRole('admin') || gs.getUser().hasRole('cmdb_admin')){
answer = true;
}
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 06:54 AM
Delete the script (because the script will remain active, as long as the field has a value) and just add the roles to the 'roles' section within the condition. You don't need to script for roles in ACL's.
And for this one: you could just add the 'cmdb_admin' role and tick 'admin override' on the ACL.
This will work, assuming the roles grant sufficient access to the table as well.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark