Configure ACL for parent records on the slush bucket and a child records for a related list

Carina4
Tera Contributor

Hi all, I need help because I'm working with an  ACL that control the behavior of a slush bucket with a records of a parent table, but I need to view and access to the records of a child table on a related list too

 

The script on the ACL is:

role: local_admin

 

var answer = (function() {
    // check if is it the Related List of 'service_item_location'
    var isServiceRelatedList = typeof parent !== 'undefined' && parent !== null && parent.getRecordClassName() ===
'service_item_location';

    if (isServiceRelatedList) {
        // Allow access if only the location is in the related list 
        return new x_amspi.SecurityUtils().isLocationManaged(current.workplace_location);
    } else if (current.getTableName() === ('service_location') {
        // Check the slush bucket in 'service_location'
        return new x_amspi.SecurityUtils().isLocationManaged(current.workplace_location);
    }
    return false
})();
 
and when I impersonated to a Local admin I got a false in 'isServiceRelatedList' var
 
Can you help me to solve it?
 
Thanks in advance.
2 REPLIES 2

Abhay Kumar1
Giga Sage

@Carina4 It looks like you're trying to control access to records in a slush bucket based on whether the user is accessing a related list from the parent table (service_item_location) or if they are interacting with a child table (service_location). The issue you're encountering is that the isServiceRelatedList variable is returning false, even when you expect it to be true. This suggests that the context of your ACL script is not correctly identifying when the related list is being accessed.

Hope this will help you.

Hi @Abhay Kumar1 I hope you are doing well, thanks for your answer. The parent table is 'service_location' and the child is 'service_item_location'.

I'm going to review the script once more.