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…
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)- A7% (3)
- B88% (38)
- C2% (1)
- D2% (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
Community Discussion
No community discussion yet for this question.