B (https://developer.servicenow.com/dev.do#!/learn/courses/washingtondc/app_store_learnv2_scripting_washingtondc_scripting_in_servicenow/app_store_learnv2_scripting_washingtondc_client_side_scripting/app_store_learnv2_scripting_washingtondc_the_glideuser_g_user_class)
The g_user.hasRoleExactly() method in ServiceNow is used to check if the currently logged-in user has a specified role and no other roles. In this case, it checks if the user has the 'catalog_admin' role and no other roles.
So, the correct method call to return true only if the currently logged-in user has the 'catalog_admin' role and in no other case is g_user.hasRoleExactly('catalog_admin')
Correct answer is B, g_user.hasRoleExactly()
Please find this g_user.hasRoleOnly() client side script that you speak of in the below ServiceNow documentation. I can wait. :D
Source: https://developer.servicenow.com/dev.do#!/reference/api/utah/client/c_GlideUserAPI
Can you guys update the correct answer? So far I've seen the "correct answer" be incorrect a little too many times and I'm not even a quarter of the way through these questions....the correct answer is B!!!
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
kundgir
Highly Voted 3 years, 2 months agonsmcan
Highly Voted 3 years, 1 month agoNisha2706
Most Recent 3 months, 2 weeks agochuks100
5 months, 3 weeks agoKlahr
5 months, 3 weeks agomanikanta_gnbv
8 months, 1 week agoevoken
10 months, 1 week agoBugPanda
1 year agobrutaltea
1 year, 1 month agoLord_Korvus
1 year, 2 months agoMru9
1 year, 3 months agoAnu_K
1 year, 3 months agostophs
1 year, 6 months agoKAAAAARIM
1 year, 11 months agog_user
2 years agoJackLopez
2 years agorpersonal2
2 years, 1 month ago