News for hackers. Stuff that matters.

RBAC: Design for users belonging to multiple roles

We are designing Identity and Access management for our Application. We have different org using our app. Each org may have some sub orgs. Users belong to one or more sub orgs. A user can have different roles in each sub org. E.g a user U1 belong to Org O1 / Sub Org SB1 and Org O1 / Sub Org SB2. Now user can have Admin role in SB1 and Non-Admin role in SB2.

Now when a U1 logins, user needs to select which sub org he wants to operate in and accordingly all roles will be fetched.

In standard RBAC, we can link user to multiple roles but that will give user all permissions in all those roles. In our case we want to ties user to multiple roles but those roles exist in different contexts SB1 and SB2. So we do not want combined evaluation of permissions from both roles. Also we want to define permissions assigned to each role at one place only.

Is there any proven extensible design to serve these kind of use cases?

( 1 comment | 3 points | on HN )
Re:RBAC: Design for users belonging to multiple roles by warrenm on Monday December 06, 2021 @10:08AM (#29460580)
>In standard RBAC, we can link user to multiple roles but that will give user all permissions in all those roles

This is only kinda true

Yes, an individual user gets the union of permissions they've been granted

HOWEVER - having Admin in suborg2 DOES NOT grant Admin in suborg1

Having Admin in OrgA that happens to have suborg1 & suborg2, of course, does grant Admin to the sub orgs (unless you've seriously bolluxed it up)

If you've got your groups correct, then the permissions users of a group have will apply to objects of that group

Permissions are supposed to be inherited/inheritable - so a permission applied at a higher level permeates to lower ones, but not the other way around

I might be an Admin in the Phoenix data center, but that doesn't make me an Admin in Tulsa - unless I'm a higher-level Admin than "data center level"