List Control

sunny13
Giga Expert

Hi All,

I'm trying to hide "Edit" in the change task related list by using advance script in list control   for people without change_manager role and also there is an OR condition with respect to state.

Please review my code,

var answer;

if(gs.hasRole == "change_manager" ) ||   (parent.state=='3' || parent.state=='4' || parent.state=='-2' || parent.state=='-13' || parent.state=='-14' || parent.state=='2' || !parent.active;)

{

  answer=false;

}

else{

  answer=true;

}

But what happens is the EDIT button is not visible to anyone with any role except ADMIN i even revoked all changes but the EDIT button is missing from the related list.

But NEW button is visible to Users

find_real_file.png

Can someone help me debug this issue.

1 ACCEPTED SOLUTION

The change_task table should be editable to the user. Make sure the MPI


Change Manager has write access to the table.


View solution in original post

31 REPLIES 31

Santosh,



Please correct me if i'm wrong i'm trying here to create an ACL for Change task table with required roles has change_manager.



find_real_file.png


In the required roles (embedded list) simply add your role (change_mananger)



Also, add the condition for your states. the two are "anded" together.



Reference:


Using Access Control Rules - ServiceNow Wiki


Security Best Practices - ServiceNow Wiki


Contextual Security - ServiceNow Wiki    


Initially i'm just trying to show the EDIT button to users with MPI Change Manager, Here is my ACL



find_real_file.png



but for some reason the EDIT button is still hidden for users with MPI CHANGE MANAGER role.



Should i use an if condition in the advance script?


FYI - Only use the Advanced condition if there is no other alternative.



You mentioned you reverted you changes, but the Edit button was not present, now you are trying to add more things on. I recommend backing out the changes until you get the Edit button back on the form and start building up conditions, ACLs, etc. from there.


I just reverted back the changes and trying with New ACL.