Home » ServiceNow » CAD » Which method call returns true only if the currently logged in user has the catalog_admin role and in no other case?
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’)
Correct Answer: C
Explanation/Reference:
Reference: https://community.servicenow.com/community?id=community_question&sys_id=dff705e6db7757c0d58ea345ca96196b
Download Printable PDF. VALID exam to help you PASS.
|
|
ANswer is B
Just an example use case for your understanding.
g_user.hasRole(‘itil’) True if the current user has the role specified, false otherwise. ALWAYS returns true if the user has the ‘admin’ role.
So for admin it will return true
hasRoleExactly(‘itil’) True if the current user has the exact role specified, false otherwise, regardless of ‘admin’ role.
Will return false for admin
should be B
It should be hasRole/hasRoleExactly option.. Most of the answers are wrong can you please check and update the correct answers