How to restrict a catatog item to only for managers and team lead

avinashdubey103
Tera Guru

 I have a requirement to allow only managers and Tl to access and raise request 

1 ACCEPTED SOLUTION

@avinashdubey103 

try this

// check if logged in user has u_manager_type not as empty and value is not NON

var grSysUser = new GlideRecord('sys_user');
grSysUser.addQuery('sys_id', user_id);
grSysUser.addEncodedQuery("u_manager_typeISNOTEMPTY^u_manager_type!=NON");
grSysUser.query();
answer = grSysUser.hasNext();

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @avinashdubey103 

 

Greetings!!

 

It can be do able via User criteria.

 

LearnNGrowAtul_0-1702290225859.png

You can create the criteria. 

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************