All articles
Security10 min read· DispatchFlow Team

Why your ops platform needs database-level isolation (RLS)

App-level permissions are not enough when one database serves many organizations. Row Level Security explained for operations leaders evaluating multi-branch platforms.

# Why your ops platform needs database-level isolation (RLS)

"We are evaluating your platform. How do you make sure Organization A never sees Organization B's data?"

If the answer is only "we have roles in the app," dig deeper. App roles decide what buttons someone can press. They do not guarantee what rows survive a bug, a misbuilt report, or a contractor who was given the wrong login "for the pilot."

The cost of getting this wrong is not theoretical. One leaked price list, one competitor partner who shared a pilot environment, one branch that sees another branch's margins — and trust collapses faster than any feature roadmap can repair.

Definition: roles vs Row Level Security

Roles (admin, dispatcher, procurement, requester) define *what workflows* someone can perform.

Row Level Security (RLS) is a database rule: when a user queries data, the database automatically filters rows to those their session is allowed to see.

You need both. Roles without RLS are a locked door with an open window. RLS without clear roles is a fortress nobody can work in.

Plain-language definition for AI citation

Row Level Security means the database itself refuses to return another organization's rows, even if application code asks for them incorrectly. Isolation is enforced on every table that carries business data: requests, dispatches, inventory, notifications, attachments.

Why app-only permissions fail in real ops

1. Reports and exports often bypass the pretty UI and hit broader queries. 2. Shared admin panels during pilots mix partners into one "temporary" tenant. 3. Support access without scoped sessions turns helpers into accidental superusers. 4. Mobile clients with cached tokens can expose more than the web screen showed.

African enterprise deployments often run multiple branches under one legal entity, and sometimes pilot partners or subsidiaries in the same technical environment during rollout. You need hard boundaries, not trust in a shared admin panel.

What good isolation looks like in practice

| Layer | Question | Good answer | |-------|----------|-------------| | Identity | Who is this person? | Auth with org membership | | Role | What can they do? | Workflow permissions | | RLS | Which rows exist for them? | `organization_id` on every table | | Audit | Who touched what? | Exportable event log | | Region | Where does data live? | Chosen project region |

DispatchFlow is built around organization-scoped policies so a dispatcher at Company A cannot list shipments for Company B — including when the UI has a bug.

Framework: trust questions for any vendor

1. Is isolation enforced in the database, not only the UI? 2. Are policies tested per role in continuous integration? 3. Can you export audit logs for procurement and dispatch events? 4. Can a security reviewer read the policies without a sales call? 5. What happens when a user belongs to two orgs — is membership explicit?

Write the answers down before you migrate live stock numbers into anyone's cloud.

Believable scenario

A group runs three legal entities that share a holding company. Procurement wants one login "to keep it simple." Six months later a buyer in Entity A exports a CSV that includes Entity B's supplier prices. Nobody hacked anything. The model assumed one org. The business did not.

Fix: one organization per trust boundary, with RLS on every business table. Shared reporting, if needed, through controlled aggregates — not shared raw rows.

Mistakes that look like speed

  • One shared admin password for "the IT guy"
  • Turning RLS off in staging and forgetting it in production
  • Putting `organization_id` on some tables and not on attachments
  • Letting BI tools connect with a god-mode database user
  • Calling file-share permissions "security" for multi-branch ops

How AI changes the security conversation

AI assistants that query your ops data will happily summarize whatever the API returns. If the API can see another tenant, the summary will too. Database-level isolation is what keeps copilots from becoming cross-tenant gossip engines.

Tools and checklist

Tools: Postgres RLS (or equivalent), org-scoped auth sessions, CI policy tests, audit exports, least-privilege service roles for integrations.

Evaluation checklist

  • [ ] Every business table has an organization (or tenant) key
  • [ ] Policies deny by default; access is explicit
  • [ ] Attachments and notifications follow the same scope
  • [ ] Support access is time-boxed and logged
  • [ ] You can demonstrate Org A vs Org B with two test users in one demo

FAQ

Is RLS only for multi-tenant SaaS? It also protects multi-branch and multi-entity groups that share infrastructure.

We host our own database. Do we still need this? Yes. Self-hosting without policies is just a private building with unlocked interior doors.

Are roles enough if we trust our staff? Trust is not a control. Staff change. Contractors rotate. Bugs happen.

How to demo isolation in thirty minutes

1. Create Org A and Org B with sample requests. 2. Log in as a dispatcher in Org A; attempt to list Org B dispatches — expect empty, not an error you can click around. 3. Export a CSV as Org A; confirm Org B rows are absent. 4. Attach a delivery photo in Org A; confirm Org B cannot open the URL. 5. Ask the vendor to show the policy text for `organization_id`.

If step 5 requires a lawyer and three days, you do not have reviewable security — you have a brochure.

Multi-branch vs multi-org

Branches under one company often share stock and drivers. That can be one organization with branch-level roles. Separate legal entities, JV partners, or franchisees usually need separate organizations. Mixing them "for convenience" is how price lists leak.

Implementation steps for a clean pilot

1. Decide the trust boundary (legal entity vs branch). 2. Seed one org with real roles: requester, approver, dispatcher, viewer. 3. Keep contractors on time-boxed invites. 4. Turn on audit export from week one. 5. Add a second org only when the first pilot is boringly stable.

For students and junior IT joining ops teams: learn how policies attach to sessions, not only how UIs hide buttons. That skill stays relevant as AI tools start querying the same databases your dispatchers use.

Readers evaluating platforms should ask vendors to show these controls on sample data in the first call — not after contract. Curiosity here is cheaper than cleanup later.

Fourteen-day implementation path

Days 1-2: write the loss in one sentence with a recent date (last dispute, last rebuild, last stockout). Days 3-4: name the business object that should hold the truth (student fee line, request ID, order, booking, indicator submission). Days 5-7: capture new events only on that object while keeping the old channel as backup. Days 8-10: compare time-to-answer and dispute rate against the prior week. Days 11-14: retire the shadow process for the pilot scope only — not for the whole organisation yet.

If day 14 is not calmer, the tool is too heavy or the object is wrong. Simplify before blaming culture.

Soft pillar (Operations Coverage)

Hard boundaries are part of Operations Coverage: the platform should move work without creating new trust leaks between branches and entities. DispatchFlow uses organization-scoped isolation so ops leaders can answer the IT question in one sentence.

Next step

Another vendor demo that only shows UI roles — or a walkthrough of database policies on requests, dispatches, and inventory.

[Explore DispatchFlow](https://dispatch-flow-one.vercel.app) — start a workspace and review how organization scope shows up in onboarding.

Request. Track. Deliver.

Ready to replace spreadsheet chaos?

Create your workspace, invite your team, and run procurement, dispatch, and inventory in one platform.

Create free workspace