Can Search Filters Reveal Restricted Documents?

Check what the sidebar reveals, as well as which documents open

Published

Expected results in a fictional permission test: procurement sees four routine supplier documents, while an authorised legal reviewer also sees one investigation and its category count.
Expected results in a fictional access test. The investigation and its document-derived category count are available only to the legal reviewer with permission.

In a custom search-screen test, a procurement officer finds four routine supplier documents. The sidebar also shows “Investigation (1)”. The officer can't open the investigation, but the count has already revealed that it exists for this supplier.

Apply the reader's authorised document scope to the whole search response: hits, totals, filter values, counts, and suggestions. A later denial at the download link cannot take back information already returned in the sidebar.

  1. 1 · Scope

    Identify permitted documents

    Use trusted identity and current access rules to establish the searchable population.

  2. 2 · Calculate

    Build the whole response

    Keep results, document-derived filters, and counts within that permitted population.

  3. 3 · Verify

    Repeat under another role

    Inspect the returned data and repeat after access changes, including cached responses.

Treat filter values as part of the document information

You might also hear the term facets: category filters, often with a count beside each value. A facet might group results by document type, department, project, or classification. Its values can reveal information even when the result list contains no restricted title or snippet.

Start with the business boundary. Procurement may read supplier onboarding files while Legal has access to an investigation. Other deployments may separate departments, use cases, individual cases, or customer tenants. Site membership alone may be broader than the audience for a particular document.

Distinguish a public category list from values discovered in documents. A published taxonomy can legitimately include “Investigation” even when the reader has no matching documents. The test concerns restricted information derived from the repository, such as a positive count for this supplier or a confidential case name suggested as a filter.

Keep permission rules separate from navigation choices

A reader can choose a supplier, date range, or document type. Those choices narrow the search. The server's access rules determine which documents may participate at all. Removing a selected category must not remove the permission restriction.

OpenSearch makes the placement of filters significant. Its filtering documentation explains that query-level Boolean filters constrain hits and aggregations, while post_filter narrows hits without narrowing the aggregation results. A permission restriction applied only as a post-filter can therefore leave wider counts available.

Some navigation designs retain counts for alternative choices in the current category. That's useful when the alternatives still come from the authorised population. Inspect every aggregation branch, including any branch that deliberately broadens the query. If an endpoint cannot calculate a count under the required access rules, withhold that count or use an approved alternative path.

What to inspect in a custom search acceptance test
OutputPossible disclosureExpected check
Results and totalA hidden title, snippet, document link, or extra result in the total.Results and reported totals use the reader's permitted population.
Category values and countsA restricted case name or a count derived from an inaccessible record.Document-derived values and counts remain within the authorised scope, including alternative filter choices.
SuggestionsA confidential project or person offered by autocomplete.Check the suggestion service as well as the main search query.
Cached responseData calculated for another role, or before access was withdrawn.Reuse depends on the relevant current permission context and the agreed access-change handling.

Repeat after access changes

Warm the cache with an authorised Legal search, then repeat the same query as Procurement. Next, remove the legal reviewer's assignment and repeat from the existing session. Inspect the response data, not only the visible controls. Hiding a filter in the browser does not remove information from a response the browser already received.

Agree how permission changes reach the search path and how cached responses are invalidated or checked before reuse. Include the interval while indexed access attributes are being updated. If the service cannot establish the required scope, report the search as unavailable rather than falling back to a wider cached result. The FormKiQ authorisation guide covers the broader relationship between policy, query constraints, and enforcement.

Worked example: four supplier files and one investigation

The files, roles, and outcomes below are fictional acceptance criteria for a custom interface.

  1. 1. Establish the expected population

    Procurement may search four routine supplier files. The assigned legal reviewer may also search a fifth document, classified as an investigation. The test records the permitted set for each identity.

  2. 2. Inspect the procurement response

    The screen returns four hits, but an aggregation built from a wider population adds “Investigation (1)”. The team treats the response as a failed test even though the investigation's file link would be denied.

  3. 3. Correct and retest the aggregation scope

    The integration applies the required permission constraints to the aggregation path. Procurement receives the four routine files and their permitted counts. Legal receives five documents and the investigation count. Clearing a business filter leaves those access boundaries intact.

  4. 4. Recheck the previous Legal session

    The team removes the legal assignment and repeats the query with a warm cache. After the configured access-change process takes effect, the response no longer includes the investigation or its derived values. Opening the document is tested separately against current permissions.

Check count accuracy separately

First verify who may contribute to a count, then assess whether its number is accurate enough for the interface. OpenSearch terms aggregations return selected buckets and can have distributed count errors under documented ordering conditions. Decide what the screen promises and test it against a known permitted set. An approximate count still needs the correct access scope.

  • Define the documents each test identity may search.
  • Inspect hits, totals, document-derived labels, counts, and suggestions.
  • Clear selected filters and test each alternative aggregation path.
  • Repeat queries across roles and after assignment or classification changes.
  • Check warm caches and the interval while index permissions are updating.
  • Verify that unknown permission state cannot produce a wider response.
  • Test numerical accuracy against a known authorised population.

The sidebar belongs in the permission test

A search response includes more than clickable documents. Test its counts, document-derived categories, suggestions, and cached data under the same reader permissions. The procurement officer should learn what they can use without learning that a restricted investigation exists.

      Start with FormKiQ Core

      The open-source foundation — API-first, deployable into your own AWS account, and free to use. Right for architecture validation and early implementation.

      Get Started Free

      Deploy FormKiQ Essentials or Advanced

      Production-ready editions for departments and complex workflows. Start with a Proof-of-Value deployment or go straight to production.

      Explore Options

      Plan an Enterprise Rollout

      For governance-heavy environments with residency, sovereignty, assurance, and multi-jurisdiction requirements. Talk to us about the right deployment model.

      Book a Call