SAG / ARCHITECTURE NOTE

RBAC and Tenant Boundaries: Completing Authorization Checks Beyond the UI

Explains the definition and necessity of RBAC, how it works, and the criteria and practical checklist for applying it to SAG architecture, supported by research and official documentation.

Download Markdown

Definition in one sentence

RBAC is an authorization model that enforces role-based permissions and data ownership boundaries at the server and database levels.

Key answer: Hiding a button alone does not prevent direct API calls. Trusting a tenant ID sent by the client risks exposing other customers’ data.

Why is this technology needed?

Hiding a button alone does not prevent direct API calls. Trusting a tenant ID sent by the client risks exposing other customers’ data.

How it works

The server looks up the session and membership, then verifies the resource’s tenant. Database RLS and composite foreign keys provide additional safeguards against mistakes.

When designing a system, accuracy is not the only consideration. Latency, cost, data boundaries, refresh intervals, and behavior on failure must also be defined to produce reproducible results in production. It is safer to leave values that automation cannot determine with confidence as unmeasured or requiring review, rather than converting them to zero or success.

How this relates to SAG technology

SAG separates platform roles from customer roles and checks membership on every request. It does not trust the client tenant header, and database constraints prevent cross-tenant references.

Practical checklist

  • Check ownership for both reads and writes
  • Verify that permission downgrades take effect starting with the next request
  • Test failures using cross-tenant IDs
  • Distinguish the states for failures, empty results, and authorization errors from success
  • Revalidate before and after changes under the same conditions

Research and official documentation

Reference documents support principles and recommendations. They do not guarantee search visibility, AI mentions, rankings, or revenue. The actual impact of implementation should be verified through observations of service data under equivalent conditions.

Also verify the execution role under which RLS is applied

Even when RLS policies are in place, table owners and roles with BYPASSRLS can bypass them. SAG’s server-side membership and tenant checks remain in place independently of this. The scope of isolation can only be assessed by checking both the database connection role and policy enforcement.

Technical references by topic

How to continue reading about this technology

Explore tenant authorization, task retries, caching, and approval history.

Articles