Menu

Laravel RBAC for Multi-Organization Portals
📰

Laravel RBAC for Multi-Organization Portals

DEV Community: laravel·Muhammad Ali Mughal·7 days ago
#hC5vAZyN
#devtolaravel#devto#dev#user#organization_id
Reading 0:00
15s threshold

A portal that serves many organizations is not “one app with a role column.” It is a matrix: user × organization × permission, plus the hard rule that a token for Org A must never read Org B’s rows even when the user belongs to both. Most IDOR bugs I hunt in Laravel portals come from checking a global role and forgetting the organization scope on the query.

I build Loop Origin , where we ship multi-tenant Laravel systems for dealers, partners, and internal ops portals. I wrote this with help from AI tools and checked every command and claim myself. Below is the RBAC shape I use when one login can administer several organizations without collapsing authorization into a single boolean.

How should Laravel RBAC work for multi-organization portals?

Direct answer: Model memberships as user-organization links with roles scoped to that organization, authorize with policies that take the org context (not only the user), and force every sensitive query through where organization_id = currentOrg() .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.