User Criteria for group managers

Brad Campbell
Tera Contributor

Hi All

 

Looking to create a new user criteria so I can restrict visibility of a catalogue item I am building to just group managers.

 

Any guidance appreciated as ever.

 

Brad

 

 

1 ACCEPTED SOLUTION

Chandler Paulse
Tera Expert

You could try something like this: 

answer = checkCondition();
function checkCondition(){
	var gr = new GlideRecord("sys_user_group");
	gr.addQuery("manager", user_id); //Looks to see if this user is listed as a manager on any user record
	gr.setLimit(1);
	gr.query();

	if(gr.hasNext()) //If the user is listed as a manager in a group
		return true;
	else
		return false;
}

 

View solution in original post

5 REPLIES 5

Hi 
thank you for your response.