Haomai Technology AI Brain

Where to check permissions in a data question

Sign-in establishes the entry point. A data question can then pass through queries, knowledge retrieval, caches, follow-ups and file downloads. Each path needs to preserve the identity and its access scope.

Access controlUpdated November 20264 min read

A shared entry point can serve different data scopes

Imagine two synthetic regions with separate order records. A reader in region A may see that region's totals. A follow-up asking “List region B as well” should grant no access to another region's detail. Apply permissions throughout execution, including the work behind the navigation menu.

Citations, conversation history and exported reports pose the same question. Testing only the first query misses the paths users take when exploring an answer.

Authentication and authorization serve different purposes

Authentication identifies the requester. Authorization governs the resources and operations available to that identity. An application may handle sign-in, while the data layer still needs to enforce scope. Hiding interface controls can prevent inadvertent actions, but server-side enforcement remains necessary.

OWASP's authorization guidance recommends denying by default and checking each request. For conversational analytics, apply that principle to follow-ups, cache hits, links to citations and downloads as well as the initial sign-in.

Keep authorization context with cached results

A cached result can be reused only within a compatible identity and data scope. A restricted reader must not receive an administrator's rollup just because the question text matches. Following a reorganization or revocation, also check access to existing conversations and files.

Caching remains an option when both storage and subsequent reads account for authorization. Test that the boundaries are enforced in practice. The appropriate strategy depends on the architecture and deployment requirements.

Test allowed and denied cases in pairs

Prepare two test identities and a synthetic dataset. Pair each successful path with a nearby denial case. Compare an in-scope query with one outside the region, the reader's own citation with someone else's, and an active identity with a revoked one.

PathWhat to compare
Initial query / follow-upIs the current authorization scope retained throughout?
Fresh result / cached resultAre the necessary access checks performed?
Page / downloadDoes the file enforce the same data boundary?
Active role / revoked roleHave the old permissions actually expired?

Include permission tests in routine changes

A new data source, a role change, a collaboration platform entry point or a component upgrade can alter access paths. Including permission cases in the regression record helps teams spot changes in scope promptly.

Record the identity, resource and expected behavior for each test. Implementation teams need those concrete results to decide whether a particular integration is ready for use.

Further reading

Back to all articles

Try “permissions,” “data source,” “manufacturing” or “API.”