How would I limit a UI action to a certain group?

Allison3
Kilo Guru

We have a group in ServiceNow who are managers. I'm wanting to limit the OOB 'Create Outage' UI action to only that manager group. This is an OOB UI action that is activated when you activate the task-outage relationship plugin.

find_real_file.png

1 ACCEPTED SOLUTION

Condition should be something like below



(current.getRecordClassName() == 'incident' || current.getRecordClassName() == 'problem') && gs.getUser().isMemberOf('SN_IT Managers')


View solution in original post

9 REPLIES 9

Patrick DeCarl1
ServiceNow Employee
ServiceNow Employee

Allison,



Try   myUserObject.isMemberOf().. gs.isMemberOf('<groupname>')



Wiki http://wiki.servicenow.com/index.php?title=Getting_a_User_Object#gsc.tab=0


Would I add this to the condition field or in the script?


Yes add an && condition followed by gs.getUser().isMemberOf('GROUP_NAME or SYS_ID' )



(rest of condition) && gs.getUser().isMemberOf('GROUP_NAME or SYS_ID' )


dvp
Mega Sage
Mega Sage

just a small change to @Patrick



You need to have getUser object



gs.getUser().isMemberOf('GROUP_NAME or SYS_ID' )