How to restrict user to see only records assigned to him??

Shivani Khedek1
Giga Contributor

Hi,

I have created a custom task table named "Record". In the assigned to field I have provided the user name.

That task should be assigned to the user provided in the "assigned_to" field. It is working fine, but the user is also able to see the tasks which are assigned to other users.

I have given the "itil" role to the user and my table can be access if the user has that "itil" role.

But the  concern is that the itil user can see all the tasks in the table instead of only tasks assigned to him/her.

Please suggest if there is any way to make the limit the tasks visible to "itil" user on the basis of tasks assigned to them.User should be able to see the tasks which are assigned to them and not the other tasks.

Please suggest, if I am doing anything wrong and how can we achieve this?

12 REPLIES 12

sachin_namjoshi
Kilo Patron
Kilo Patron

hi,

you can configure ACL to show records which are assigned to logged in user.

Please check below sample code and modify as per your custom table name etc

 

Table: incident


Operation: read




Script:


anwer = checkUser();



function checkUser(){


if (gs.getUserID() == current.assigned_to){return true;}



return false;


}

 

Regards,

Sachin

hey,

actually I have assigned an ITIL role for all my users who would be able to records in table. So being an ITIL user, he/she can see all records, and I want to restrict it to his/her records only.

Please suggest

It worked ! 

Thank you so much.. 

Regards,

shivani

Hi Shivani,

 

Please mark my answer as correct so that others can benefit from similar question.

 

Regards,

Sachin