Identity and permissions

Row-level data scope

All / department / department and below / self only / custom, injected uniformly by the data access layer.

The scopes

ScopeMeaningTypical user
Allignores data boundariessystem administrator
Departmentdata of the current department onlydepartment head
Department and belowthe department and its childrenmanager in a multi-level org
Self onlyonly own dataregular member
Customa specified set of departmentscross-department roles

Where it is injected

Scope conditions are injected uniformly by the data access layer; business code is unaware and never hand-writes the check. That is the fundamental difference from "an if in every service", which will always miss one.

Hand-written SQL: what to watch

  • Statements that use the framework query capabilities get scope conditions automatically.
  • Hand-written XML is not covered by automatic injection; add scope and soft-delete conditions yourself.
  • For multi-table joins use the sort-key allowlist; never concatenate an unvalidated sort string.

How to debug

  1. First confirm with a high-privilege account that the data exists, ruling out a query-condition problem.
  2. Then check the data scope bound to that account's role.
  3. Finally check whether this query went through hand-written SQL.
Last updated 2026-10-09Edit this page →