Truegate
Skip to content

Under the Hood of Truegate: Multi-Tenant Architecture and Team-Scoped RBAC for High-Security Gated Communities

Under the Hood of Truegate: Multi-Tenant Architecture and Team-Scoped RBAC for High-Security Gated Communities Comparisons Special Guide
TrueGate Society Platform Billing, ledger and gate security in one ad-free app
Book a Demo

In residential PropTech, software security is physical security. If a multi-tenant flaw allows an administrator in Society A to view the financials or resident records of Society B, the platform has failed at its core engineering premise.

Database-Per-Tenant vs Discriminator Column Multi-Tenancy

When architecting Truegate for hundreds of housing societies and thousands of daily gate transactions, our engineering team evaluated two distinct multi-tenant paradigms:

Dimension Database-per-Tenant Discriminator Column (Truegate)
Migration Velocity Slow (running 500 migrations sequentially) Instant (single atomic schema migration)
Database Connection Pooling Exhausts server pool quickly Optimized (high-efficiency connection pool)
Cross-Society Tenant Switching Heavy connection switching overhead Fast (swapping team context in memory)
Isolation Enforcement Guaranteed by DB boundary Guaranteed via Global Scopes & Foreign Keys

How TrueGate Keeps Society Data Separate

Truegate enforces isolation through a strict 3-tier security pipeline:

  1. ActiveTenancy Middleware: On every incoming HTTP request, ActiveSocietyMiddleware resolves the authenticated user's active society context. Any attempt to query records from a foreign society_id triggers an immediate 403 Unauthorized response.
  2. Team-Scoped RBAC via Spatie: Truegate uses Spatie Laravel-Permission in teams mode. When an admin logs in, setPermissionsTeamId($societyId) sets the authorization scope. An account that is an admin in Society #12 has zero permissions if they access Society #15.
  3. Indexing by Society: Records are indexed by society so each query reads only that society's data efficiently.
Back to Knowledge Hub Truegate Society Guides
Modernize Your Society with Truegate

Ready to Elevate Security, Accounting & Operations in Your Society?

Eliminate manual spreadsheets, improve guard accountability, and simplify visitor approvals. Experience ad-free society management backed by dedicated engineering support.