We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

hpw to write acl script for cmdb table to write records as per userlocation

raj765_32
Tera Contributor

Hi 
Can anyone help me with scenario for:

user wanted to write records as per his location assets attached

example:

When user is of india location all the assets in cmdb table of india location needs to be in edit mode 

 

1 REPLY 1

Dushyant Siroh
Tera Expert

hi @raj765_32 

 

(function() {

if(gs.hasRole('admin'))
{
return true;
}

var userLocation =  gs.getUser().getRecord().location;

if(!userLocation || userLocation.name!='India')
{
return false;
}

var ciLocation = current.location;

if(!ciLocation || ciLocation.name='India')
{
return false;
}
reurn true;
})();

Kinds Regards,

Dushyant Siorhi