ACL not working/running

F_bio Santos
Kilo Sage

Hi everyone, Im trying to create an ACL where it will check if the current logged in user "location" has the same value as a custom field "u_site" which is a reference field for the "cmn_location" table. I have tried to do this with an "advanced" ACL, but it is not working, it almost looks like the ACL is not even running. Can anyone help with this please ?

Here is the code that Im using and some printscreens of the ACL:

Code: 

(function() {
    var userLocation = gs.getUser().getLocationID();

    if (!current.u_site && !userLocation) {
        return false;
    }

    if (userLocation != current.u_site) {
        return false;
    }

   /* if (userLocation == current.u_site) {
        answer = true;
    }*/
    return current.u_site == userLocation;
})();


Prints:

F_bioSantos_0-1748271504259.png


F_bioSantos_1-1748271516345.png

 

 

1 ACCEPTED SOLUTION

Chaitanya ILCR
Kilo Patron

Hi @F_bio Santos ,

 

this one line is enough

current.getValue('u_site') && gs.getUser().getLocation().toString() == current.getValue('u_site');

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

View solution in original post

5 REPLIES 5

check if you have added any roles in the ACL

or check if there any security attributes 

does that user has the ACL specified role or meet the security attribute criteria?

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya