nerdexam
ServiceNow

CAD · Question #211

Which of the following methods are useful in Access Control scripts?

The correct answer is B. gs.hasRole() and current.isNewRecord(). ACL (Access Control) scripts execute server-side in ServiceNow. The correct server-side methods are: 'gs.hasRole()' from the GlideSystem class, used to check if the current user has a specific role; and 'current.isNewRecord()' from GlideRecord, used to check if the record being…

Submitted by layla.eg· Apr 18, 2026Security and Restricting Access

Question

Which of the following methods are useful in Access Control scripts?

Options

  • Ag_user.hasRole() and current.isNewRecord()
  • Bgs.hasRole() and current.isNewRecord()
  • Cg_user.hasRole() and current.isNew()
  • Dgs.hasRole() and current.isNew()

How the community answered

(43 responses)
  • A
    7% (3)
  • B
    88% (38)
  • C
    2% (1)
  • D
    2% (1)

Explanation

ACL (Access Control) scripts execute server-side in ServiceNow. The correct server-side methods are: 'gs.hasRole()' from the GlideSystem class, used to check if the current user has a specific role; and 'current.isNewRecord()' from GlideRecord, used to check if the record being accessed is new. 'g_user.hasRole()' is a client-side GlideUser method used in client scripts and UI policies - it is NOT available in server-side ACL scripts. 'current.isNew()' is not a valid GlideRecord method; the correct method name is 'isNewRecord()'. Therefore, only option B contains both correct server-side methods.

Topics

#Access Control List (ACL)#Server-side scripting#GlideSystem (gs)#GlideRecord (current)

Community Discussion

No community discussion yet for this question.

Full CAD Practice