When I build a system, I give particular attention to user rights, roles and security configuration. Over time I have settled on an approach to roles and permissions that is flexible enough to adapt to almost any new system I take on.
The core of the model is hierarchy. There are leaders who sit above other members of a team, and team members who can act on entities inside the team. The set of actions available to each person is different, and that difference is the whole point: a role is not a label, it is a precise answer to "what may this person do, and to which entities".
It comes down to three moving parts kept separate:
Identity - who the person is, and which team or organization they belong to.
Roles - a named position in the hierarchy, such as admin, manager, or a plain member.
Permissions - the concrete actions a role grants, resolved against the specific entities the person can reach.
Keeping those three apart is what makes the model portable. The permissions are expressed as a claim carried on the user's identity, so a request is authorized by reading what the identity already proves rather than by re-deriving it every time. Swap the entity names and the hierarchy depth, and the same structure fits a new domain without a rewrite.
The last screenshot is from how the fit actually gets chosen. Together with the other engineers we got on a call, ran a brainstorm, and picked the authorization strategy best suited to that particular system, weighing its hierarchy and the set of actions each role needed. The model gives the starting shape; the brainstorm tailors it. That pairing is why the same approach keeps working across very different products.
The permissions in detail
The worked-out permission model for the system is below: the roles, the actions each one grants, and how they map to entities.
Before: US medical practitioners had to piece together income, referrals and cash flows from systems that were slow to integrate.
After: as a principal/founding engineer I own API development end to end for my pods, building enterprise-grade interfaces on Node.js with Python background data processing.
The team at Jiro Health sent me branded merch. I live in Buenos Aires, so the place for the photoshoot, under the murals of the Hospital de Clínicas, almost chose itself.
How an in-house pipeline at Jiro Health finds vulnerable dependencies across repositories, patches them safely, and delivers one reviewable fix PR with a Jira ticket and Slack summary.
Open for contract collaboration
I am available for contract-based collaboration. If you have an interesting project idea, schedule a call via Calendly.