Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam CAD All Questions

View all questions & answers for the CAD exam

Exam CAD topic 1 question 19 discussion

Actual exam question from ServiceNow's CAD
Question #: 19
Topic #: 1
[All CAD Questions]

Which method call returns true only if the currently logged in user has the catalog_admin role and in no other case?

  • A. g_user.hasRole('catalog_admin')
  • B. g_user.hasRoleExactly('catalog_admin')
  • C. g_user.hasRoleOnly('catalog_admin')
  • D. g_user.hasRoleFromList('catalog_admin')
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
kundgir
Highly Voted 3 years, 2 months ago
Answer is incorrect , It should be B
upvoted 14 times
...
nsmcan
Highly Voted 3 years, 1 month ago
Correct answer is B. There is no g_user.hasRoleOnly function
upvoted 14 times
...
Nisha2706
Most Recent 3 months, 2 weeks ago
it's B
upvoted 1 times
...
chuks100
5 months, 3 weeks ago
B is correct
upvoted 1 times
...
Klahr
5 months, 3 weeks ago
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)
upvoted 1 times
...
manikanta_gnbv
8 months, 1 week ago
Selected Answer: B
B is Correct
upvoted 1 times
...
evoken
10 months, 1 week ago
Selected Answer: B
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')
upvoted 2 times
...
BugPanda
1 year ago
Selected Answer: B
B is the correct one
upvoted 1 times
...
brutaltea
1 year, 1 month ago
Selected Answer: B
Correct answer is B, there is no hasRoleOnly methond in g_user
upvoted 3 times
...
Lord_Korvus
1 year, 2 months ago
Selected Answer: B
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
upvoted 1 times
...
Mru9
1 year, 3 months ago
Answer is B
upvoted 1 times
...
Anu_K
1 year, 3 months ago
Selected Answer: B
Has role exactly.
upvoted 1 times
...
stophs
1 year, 6 months ago
Selected Answer: B
B IS CORRECT
upvoted 3 times
...
KAAAAARIM
1 year, 11 months ago
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!!!
upvoted 3 times
...
g_user
2 years ago
let it b, let it b...
upvoted 2 times
...
JackLopez
2 years ago
Selected Answer: B
Should be B
upvoted 3 times
...
rpersonal2
2 years, 1 month ago
Selected Answer: B
Exactly. There is no roleOnly
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.

SaveCancel
Loading ...