ACL Dot walked field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2024 11:12 AM
Can anyone tell me if this is possible do to with an ACL.
Give write access for a role to a dot walked field for the child form.
FieldA is defined in a parent table and is on the parent form.
The child form has the same field on the form via dot waking.
Can an ACL be created to allow edit of FieldA on the child form only for a certain role, and keep the field read only on the Parent form for that same role.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2024 11:23 AM
@Community Alums.
It could be possible.
You might have to create 2 ACLs, first on the parent table field to deny access for that role and second on the child table to allow access for the same role.
ACLs for the Parent Table, for example, Incident
- Type: Record
- Operation: Write
- Name: incident.FieldA
- Requires role: Choose the role(s) that should have access.
Write a condition or script to explicitly deny write access for this role on the parent table.
ACLs for the Child Table, for example, incident_task
- Type: Record
- Operation: Write
- Name: incident_task.FieldA
- Requires role: Choose the role(s) that should have write access.
Write a condition or script that checks if the current record is from the child table (e.g., current.getTableName() == 'incident_task') and grants write access only if the record matches this condition.
NOTE: It's not tested, please try it in your lower environment first.
Please mark the answer as helpful and correct if helped.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2024 11:30 AM
The issue is that in my example FieldA is only in the parent table, it is not in the child table.
It is on the Parent form directly.
It is added to the Child form via dot walking.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2024 12:04 PM
In that case, you can try the ACL script on child table
if (gs.hasRole('itil')) {
var parentFieldValue = current.parent.fieldA;
if (parentFieldValue !== null) {
answer = true;
} else {
answer = false;
}
} else {
answer = false;
}