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

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

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: C 🗳️
Reference:
https://community.servicenow.com/community?id=community_question&sys_id=dff705e6db7757c0d58ea345ca96196b

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
kundgir
Highly Voted 2 years, 6 months ago
Answer is incorrect , It should be B
upvoted 14 times
...
nsmcan
Highly Voted 2 years, 5 months ago
Correct answer is B. There is no g_user.hasRoleOnly function
upvoted 14 times
...
manikanta_gnbv
Most Recent 2 weeks, 2 days ago
Selected Answer: B
B is Correct
upvoted 1 times
...
evoken
2 months, 2 weeks 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 1 times
...
BugPanda
4 months, 3 weeks ago
Selected Answer: B
B is the correct one
upvoted 1 times
...
brutaltea
5 months, 1 week ago
Selected Answer: B
Correct answer is B, there is no hasRoleOnly methond in g_user
upvoted 3 times
...
Lord_Korvus
7 months, 1 week 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
7 months, 3 weeks ago
Answer is B
upvoted 1 times
...
Anu_K
8 months ago
Selected Answer: B
Has role exactly.
upvoted 1 times
...
stophs
11 months ago
Selected Answer: B
B IS CORRECT
upvoted 3 times
...
KAAAAARIM
1 year, 3 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
1 year, 4 months ago
let it b, let it b...
upvoted 2 times
...
JackLopez
1 year, 4 months ago
Selected Answer: B
Should be B
upvoted 3 times
...
rpersonal2
1 year, 5 months ago
Selected Answer: B
Exactly. There is no roleOnly
upvoted 3 times
...
Farnous
1 year, 7 months ago
Selected Answer: B
B is correct
upvoted 3 times
...
Gurubala
1 year, 7 months ago
Selected Answer: B
Answer is B .
upvoted 3 times
...
Krundol
1 year, 8 months ago
Selected Answer: B
Answer is B
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 ...