Make asset record read only based location of logged in user

Akshaykhare
Tera Contributor

In alm_asset table I have location field. My requirement is, the asset record should be editable to only those users whose location match with the location of asset record. For others it should be read only except for admins and some other roles. Please suggest how to implement this

1 ACCEPTED SOLUTION

J Siva
Tera Sage

Hi @Akshaykhare 
Create a 'Deny Unless' Write ACL on the alm_asset table, using an advanced script condition to validate the logged-in user's location.

JSiva_0-1749117325341.png

JSiva_1-1749117343013.png

if (current.getValue('location') == gs.getUser().getRecord().getValue('location')) {
    answer = true;
} else {
    answer = false;
}

 


Regards,
Siva

View solution in original post

1 REPLY 1

J Siva
Tera Sage

Hi @Akshaykhare 
Create a 'Deny Unless' Write ACL on the alm_asset table, using an advanced script condition to validate the logged-in user's location.

JSiva_0-1749117325341.png

JSiva_1-1749117343013.png

if (current.getValue('location') == gs.getUser().getRecord().getValue('location')) {
    answer = true;
} else {
    answer = false;
}

 


Regards,
Siva