ExamGecko
Question list
Search
Search

Question 56 - CAD discussion

Report
Export

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

A.
g_user.hasRole() and current.isNewRecord()
Answers
A.
g_user.hasRole() and current.isNewRecord()
B.
gs.hasRole() and current.isNewRecord()
Answers
B.
gs.hasRole() and current.isNewRecord()
C.
g_user.hasRole() and current.isNew()
Answers
C.
g_user.hasRole() and current.isNew()
D.
gs.hasRole() and current.isNew()
Answers
D.
gs.hasRole() and current.isNew()
Suggested answer: B

Explanation:

Access Control scripts are server-side scripts that run when an Access Control rule is evaluated. They can use the gs and current objects to access the GlideSystem and GlideRecord methods, respectively. Some of the useful methods in Access Control scripts are:

gs.hasRole() - This method checks if the current user has a specified role. It returns true if the user has the role, and false otherwise. For example, gs.hasRole('admin') will return true if the user is an administrator, and false otherwise.

current.isNewRecord() - This method checks if the current record is a new record that has not been inserted into the database yet. It returns true if the record is new, and false otherwise. For example, current.isNewRecord() will return true if the record is being created, and false if the record is being updated or deleted.

The methods g_user.hasRole() and current.isNew() are not part of the server-side scripting API. They are part of the client-side scripting API, which is used in Client Scripts and UI Policies. They cannot be used in Access Control scripts.

References:

[Access Control scripts]

[GlideSystem methods]

[GlideRecord methods]

asked 23/09/2024
Lampros Diamantopoulos
31 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first