Write ACL on readonly field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 08:53 PM
I'm trying to give Write access to 'Operational Status' field (which is a Read only field via Dictionary override) to a particular group but unable to do so.
I'm explaining the scenario as below -
In the base table cmdb_ci I've a field called Operational Status.
Same field is there in the database table which is extended table of base table (cmdb_ci_database).
My requirement is to make the Operational Status field readonly for all the users except Admin and Asset team group (asset_group).
So, I made the field readonly through dictionary override. I've created an ACL for write operation and given the role as admin.
Now I'm checking irrespective I'm an Admin, still it's showing readonly for me.
Also how I can give write access to a particular group?
Please help me to solve this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 09:06 PM - edited 02-28-2024 09:07 PM
Hi @Bijay Kumar Sha the field is showing readonly for you because you have made readonly through dictionary override. you cant do this when you want to handle the readonly through ACL,
Delete the dictionary override you created.
Create a write ACL like below
Table Name:cmdb_ci_database
field Operational Status.
script:
if( gs.hasRole('admin') || gs.getUser().isMemberOf('groupname'))
{
answer = true; // grant access
}
else
{
answer = false;
}
Harish