To make fields read only based on assignment group

moulik1
Kilo Guru

Hello All,

In our scenario we have created a list of tasks and all the tasks are assigned to some assignment groups.

If the user is from ABC group and when he tries to open a task (which is assigned to another group) from a list of tasks in requested item then all the fields of that task should be read only and an alert message has to be shown that you don't have access to this task.

how can we achieve the above scenario?

Thanks.

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Moulik,



ACL's is the best way to achieve this. You can restrict the write access to the table. Here is the script section you can use.


answer= checkIfMember();


function checkIfMember()


{


  var current_user= gs.getUser();


  return current_user.isMemberOf(current.assignment_group.name);


}






View solution in original post

12 REPLIES 12

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Moulik,



ACL's is the best way to achieve this. You can restrict the write access to the table. Here is the script section you can use.


answer= checkIfMember();


function checkIfMember()


{


  var current_user= gs.getUser();


  return current_user.isMemberOf(current.assignment_group.name);


}






Thanks Pradeep,



so for the scenario do we have to write a new ACL ? please let me know



Thanks.


Correct.


Hello Pradeep,



wanted to know like can we use onLoad client script using getMyGroups() ?


if yes please let me know how to implement it.



Thanks.