Restrict records based on user who manages the PC/Laptop

Rajamouly
Tera Expert

HI,

 

There is a requirement for the users who is managing the PC/Laptops for their location should create/edit the records in computer table.

 

Lets assume User ABC is part of Australia location and he manages 100 devices, User XYZ is a part of India location, he manages 50 devices.Here user ABC should not create/edit records for India locations and user XYZ should not create/edit records in Australia location.

 

I have created three ACL's Create/Read/Write for computer table and written the below script, which is not working

 

Rajamouly_0-1690909733957.png

 

I have enabled the log in script, i am able to get the loggedin user but its not allowing to write/read the records

Rajamouly_2-1690908800372.png

 

 

 

2 REPLIES 2

Swapna Abburi
Mega Sage
Mega Sage

@Rajamouly Replace below line of code

var user = gs.getUserDisplayName();

with

var user = gs.getUserID();

 

Managed by field on CMDB is a reference field so we need to compare it with sys_id.

HI @Swapna Abburi 

Thanks for your response.

 

I have already used gs.getUSerID(), its giving sys_id, But still the user not able to see the records. Am i doing anything wrong here?

 

Rajamouly_0-1690964466752.png