Troubleshoot ACL security constraints causing insufficient access errors This KB article will help you identify the ACL causing "insufficient access", "rows removed by security constraints", or "security constraints prevent access" errors. Below are some scenarios where you may experience these errors When accessing lists, forms, or pages, users may see one of the following messages: Part of the query on incident has been ignored because of insufficient access for 'query_range' operation on incident.state Part of the query on incident has been ignored because of insufficient access for 'query_match' operation on incident.state Number of rows removed from this list by Security constraints: X Security constraints prevent access to requested page Users may also be unable to see expected records without any message being displayed. These messages and behaviors indicate that an access control (ACL) rule is denying the requested operation. They reflect your instance's security configuration, not a platform defect. This article explains how to identify the specific ACL responsible. Troubleshooting Roles Further down, this article will address each error message cause, effect & remediation. For now, follow the guide below to set up troubleshooting. The following roles are required to complete the steps in this article(NOTE: admin role includes all of these): script_debugger: required to open Session Log, which displays ACL evaluations in real timesnc_required_script_writer_permission: required to run background scripts when Scripting Governance is active (active by default)background_script_admin: required to run background scripts If the glide.script_processor.admin system property is set, the role it specifies is required instead. impersonator: required to impersonate the affected user Setup Open four browser tabs on your instance, referred to below as Tab A, Tab B, Tab C, and Tab D. For each tab, it's best to start on the instance homepage if this is your first time. Complete the steps in order. Tab A Enter $jsdebugger.do under All menu or use the URL template below https://<instance>.service-now.com/$jsdebugger.do In the top left navigation bar, click "Session Log" Tab B Perform setup steps to reproduce the issue but don't reproduce it yet The goal is to get to the last step before reproducing the issue. For example, if a field is unexpectedly read-only on a form, open that record so that you only need to reload the form to reproduce the issue. This keeps the log free of unrelated entries. Tab C Access background scripts Enter sys.scripts.do under All menu or use the URL template below https://<instance>.service-now.com/sys.scripts.do Copy background script below & paste it at sys.scripts.do on your instance // This will print ACL's which grant access to resource GlideSessionDebug.enable("security_grant"); // This will print ACL's which refuse access to resource GlideSessionDebug.enable("security_refuse"); Run only the line that matches what you are troubleshooting, then click "Run script". Running only one of these reduces log volume and makes the results easier to review. Tab D(if impersonation is required) Type & enter impersonate_dialog.do from All menu or paste after .com/ like before, example below https://<instance>.service-now.com/impersonate_dialog.do Impersonate the affected user Skip this tab if you are reproducing the issue as yourselfAfter impersonation, the tab redirects to the home page. This is expected. Navigate to impersonate_dialog.do again and leave the dialog open so that you can end impersonation quickly later. Once you've reached this point, return to Tab A and click Clear log, then confirm by clicking the red Clear log button, see screenshot below Steps Tab B Reproduce the issue Using the previous example of reading on State field for incident table, right-click on the form header & click "Reload form"Wait until the issue appears Tab A Stop logging Click Settings, click Select All twice to clear every selection, and then click Enable to apply the change. (With nothing selected, Enable turns logging off.)Session logging can slow or freeze your session, so disable it as soon as the issue is reproduced. Logging affects only your own session, not other users. Tab D(if impersonating) Unimpersonate End impersonation by selecting your own user, listed first and highlighted in green. Return to Tab A to review the logs. The next section is dedicated towards how to read ACL logs. Analysis In Tab A, review only the entries where CONTEXT matches the display value of the affected record (for example, the incident number). Entries with any other context are usually unrelated and can be ignored.For each ACL evaluated in that context, note the operation (for example, read or write), the rule name (for example, incident.state), and whether it passed or failed.Identify the failed rule and which of its checks failed: required roles, condition, or script. That is the check to adjust in order to grant or restrict access. Review the screenshot below. What matters are the logs that are evaluating in context of the record in question Messages Part of the query on incident has been ignored because of insufficient access for 'query_range' operation on incident.state The user does not pass the query_range ACL for the incident.state field The failing rule may be incident.state, incident.*, or, if no incident-level rule exists, the inherited task.state or task.* ruleThis reflects the current security configuration. For remediation, see Query ACL documentation below https://www.servicenow.com/docs/r/platform-security/access-control/query-acl-rule.html Part of the query on incident has been ignored because of insufficient access for 'query_match' operation on incident.state The same as above, but for the query_match operation. query_match ACLs control exact-match operators (such as is, is not, is empty, is one of, etc...), while query_range ACLs control range and pattern operators (such as greater than, contains, starts with, etc...). Number of rows removed from this list by Security constraints: X The user can read the table but fails the record-level read ACL (for example, an incident read rule with a condition or script) for some records, so those records are removed from the list Field-level ACLs (incident.<field>, incident.*) hide field values but do not remove rowsUse the Session Log steps above to identify which record-level read ACL is failing Security constraints prevent access to the page The user fails the table-level read ACL (for example, the incident table) Use the Session Log steps above to identify the failing table ACL Common Issues "I don't see any logs" If no entries appear in Tab A, log out by using the URL template below in a separate tab then log back in: https://<instance>.service-now.com/logout.do Logging out resets session debugging and impersonation, so repeat the steps for Tab C and Tab D. "I don't see any filled circles during ACL evaluation" This can occur when the resource belongs to a scoped application that has no ACLs defined in that scope. The ACL log displays the scope being evaluated, as shown below. If an ACL is required in that scope, create and test it in a non-production instance first, as new ACLs change access for all users. See screenshot below of what this looks like in Session Log. Tips query_range and query_match ACLs are not always shown in Session Log To review them manually: Open the affected table in list view.Right-click any column header and select Configure > Security Rules.Filter the list: Operation is <operation> (e.g., read, write, query_range)Type is <type> (e.g., record for tables and fields, ux_route for workspace pages)Add Sort » Created » z to a Related articles KB2130442 – Troubleshoot query_range and query_match ACL access issuesKB3221567 – About insufficient access for 'query_range' operation due to HasQueryRangeRoleKB3225162 – "X rows removed by security constraints" message not displayed when there is no pagination (all three are customer-visible)..Access control FAQ https://www.servicenow.com/docs/r/platform-security/access-control/frequently-asked-questions.html