36 questions from the Security and Restricting Access domain of the ServiceNow Certified Application Developer (CAD) exam, each with its answer and an explanation. Read them through as revision, then sit the full practice exam to test yourself on them under multiple-choice conditions.
Answer
Access control scripts run on the server, so they use GlideSystem methods such as gs.hasRole() and GlideRecord methods on current such as isNewRecord(), which checks whether the record has not been saved yet. g_user is a client-side object.
Answer
Access control rules are named for a table (table.None), every field on a table (table.*) or one field (table.field). There is no table.id form for a single record; access to particular records is limited with a condition or a script.
Answer
Setting Accessible from to This application scope only limits the table to its own application, so no other scope can create records or configuration on it. Clearing Can create only stops other scopes from creating data records, and web service access is a separate setting.
Answer
Business rules run on the server, where gs.hasRole('admin') checks the logged-in user's roles. g_form exists only in the browser and has no role methods, and hasRoleExactly() is a g_user method, not a GlideSystem one.
Answer
ServiceNow looks for the most specific rule first, such as a rule for the exact table and field, and falls back to more generic rules, such as a parent table or the * wildcard, only when no more specific match exists.
Answer
g_user.hasRole() also returns true for users with the admin role, because admin passes every role check. g_user.hasRoleExactly() returns true only when the user actually has the named role. hasRoleOnly() doesn't exist, and hasRoleFromList() checks a list of roles with the same admin behavior as hasRole().
Answer
Allow configuration lets applications in other scopes create configuration on the table, such as business rules, client scripts and UI actions. It doesn't let users change the application's own scripts or let other scopes add tables to it.
Answer
A new table in a scoped application is accessible from all application scopes by default, with read access allowed. Script includes, workflows and REST messages are created as accessible from this application scope only.
Answer
Other scopes can't create, update or delete records they aren't allowed to read, so clearing Can read makes Can create, Can update and Can delete unavailable.
Answer
Application access settings on tables and scripts decide what other application scopes can do with an application's resources, such as reading or changing a table or calling a script include. Access controls restrict users, and application roles are granted to users, not to other applications.
Answer
The itil user passes the table rule x.None, so the records can be read. For x3 the most specific rule is x.x3, which allows itil. For x1 and x2 there is no field rule, so x.* applies, and it only allows admin. The user can therefore read only x3.
Answer
A table usually has both: table.None controls access to the records, and table.* controls access to the fields that don't have their own rule. A user must pass the record rule and then the field rule to see a field's value.
Answer
An application's tables work without access controls, but their data is then not properly protected. ServiceNow offers to create a role and access controls when you create a table in a scoped application, and defining them is a best practice.
Answer
hasRole() always returns true for users with the admin role, whatever role is passed in. Use g_user.hasRoleExactly() when an admin should only pass if they actually have the role.
Answer
In the security rule debug output, a blue result means the access control's outcome came from the cache, so it wasn't evaluated again. Green shows a rule that passed and red shows a rule that failed.
Answer
Runtime access tracking controls which cross-scope operations an application's scripts may perform. Tracking records the operations and allows them, Enforcing blocks any operation an administrator hasn't authorized, and None turns tracking off.
Answer
Allow access to this table via web services makes the table available to web service requests, both REST and SOAP, but it doesn't bypass security. The user making the request still has to pass the table's access controls to read or change its records.
Answer
An access control grants access only when its roles, condition and script all pass. Other matching access controls at the same level don't all have to pass: passing one of them is enough.
Answer
Accessible from All application scopes with Can delete selected allows scripts in other scopes to delete the table's records, and Allow configuration lets them create business rules on it. A business rule in another scoped application can therefore delete XYTable's records.
Answer
Access to a table's records is governed by its access controls, so a user can see the records only after passing the table's read rules, such as having a required role.
Answer
Selecting Advanced on an access control shows the Script field, so the rule can use a script as well as roles and a condition. There is no Script check box.
Answer
With Tracking or Enforcing, the cross-scope operations an application's scripts perform are recorded in the Application Cross-Scope Access table, where they can be allowed or denied. With None, nothing is recorded.
Answers
Certificate-based authentication lets users log in to the Service Portal with a smart card, such as a Common Access Card (CAC) or a Personal Identity Verification (PIV) card. The other card types are not supported methods.
Answer
An access control checks its required roles first, then its condition, and then its script. All three must pass for the rule to grant access.
Answer
Creating and viewing CMDB baselines, which are snapshots of CIs used to compare later changes, requires the ecmdb_admin role. The cmdb_admin role on its own is not the role for baselines.
Answer
Yes. Debugging for security rules can be turned on from the navigator, and it then shows which access controls were evaluated for each record and field and whether they passed or failed.
Answer
An access control grants access only when its condition and script evaluate to true and the user has one of its required roles, or the rule has no roles. To access a field on a record, the user must also pass both the table-level and the field-level rules.
Answer
Setting the glide.ui.forgetme system property to true removes the Remember me check box from the login page.
Answer
Adding the glide.sys_reference_row_check system property and setting it to true makes the script conditions of access control rules also apply to a table's reference fields.
Answer
Table.None is a row-level rule that controls access to the table's records, and Table.* is a field-level rule that applies to every field without its own rule. A user must pass both, so with Table.None for admin and itil and Table.* for admin only, itil users can't read the fields.
Answers
The itil role gives fulfillers access to requests and requested items, and sn_request_itil and sn_request_write let users work on and update request records, which following up requires. ritm_write is not a role, catalog is for managing the catalog itself, and sn_request_admin is for administration.
Answer
The History Set [sys_history_set] table identifies the records from an audited table that have history, and the History [sys_history_line] table holds the individual field changes for each of them. The other options mix up what these tables hold.
Answer
Access controls are evaluated for the table first and then for the field. A user who fails the table rule can't access the record at all, so field rules are only checked after the table rule passes.
Answer
The itil user passes the MyTable.None rule, so they can read the records. field3 has its own rule that only allows admin, so it stays hidden from itil, while field1 and field2 have no field rules restricting them. The user can therefore read field1 and field2.
Answer
Security rule debugging is turned on with the Debug Security Rules module under System Security > Debugging. It then shows which access controls were evaluated on each page and whether they passed.
Answer
Application access has separate settings for whether other scopes can create, update and delete a table's records. Query is not one of the operations it controls.