We have an in-app permissions setup, which is familiar to all of us, but does not seem to be as easy to config as one would hope.
Basically, it is permissions like you are used to with google drive, airtable, slack, your PM/task tools, etc … and that is that you give someone access to a certain type of asset, with a certain permissions level for that asset.
Additional, this permission is usually inherited to child assets in the hierarchy with the same permissions, unless a child has their permissions over-ridden as private, etc.
The access to these assets is based off the asset “type” being shared with other users, within a hierarchy, and for certain permissions (ie crud, etc) for each asset that is shared with the other user.
To us, this seems to be hybrid ABAC → RBAC … as in, the user gets permissions to a certain assetID and type, and for that assetID and type, they are granted certain roles, for that asset type.
For us, we have a number of assets within a hierarchy, such as:
- organisation {one:many} child-organisation
- project {one:many} child-project
- dashboard {one:many} tile {many:many} data-connector, etc …
And for each asset type, we have certain roles. such as:
- owner, manager, collaborator, guest-edit, guest-view, public, etc
This means that the OWNER of dashboardID9akje86874, within projectID987365, which is within orgID362, wishes to share that dashboard with userIDkjshu8r6783 and give them the permissions of a guest-view for ONLY dashboardID9akje86874.
userIDkjshu8r6783 can only view the dashboard, they are unable to see detail of the org or the project, unless it is displayed on the dashboard.
(like when someone shares a file or folder with you from google drive, you can see what is within that asset that is shared with you, but not the parent structure/assets).
That same OWNER has permissions to add someone else to projectID987365 with collaborator permissions on the project. They would then be able to see the project details and all the dashboards in the project.
We are currently investigating the following libraries, which seem to solidly support hybrid ABAC/RBAC permissions scenario:
Has anyone looked at these, and any thoughts on which may/may not work best with RedwoodJS ?
Thanks in advance for any thoughts, advice or assistance on how to approach.
Max
ps: have looked at other threads, but have not seen anything beyond a mention of CASL (which we looked at, but didn’t seem to extend far enough).
pps: we had been playing with blitz also, and there is no solution (less evolved than redwood) there without external libraries either. The approach in schema base only takes so far in both, and is easy to have this in the prisma2 structure (and prisma is great to help with this once you work it out), but the per asset, per type, then roles on tops of that being managed in a scalable way, then retrievable in the UI for a userID, or an assetID, and for sharing on individual asset in a hierarchy needs a bit more heavy lifting (and my be more than what we can spin up ourselves with any surety we haven’t stuffed it up).
Would love to work this out, as will help us a HUGE deal to move forward, as permissions is where we are blocked at the moment
Refs:
- Is there another term for covering permissions that based on “ownership” on top of roles?
- https://redwoodjs.com/docs/authentication.html
- Authorization RBAC with dynamic roles - #14 by viperfx
- Role-based Access Control (RBAC) | RedwoodJS Docs
- Best practices for user permissions based on schema relationships - #5 by dthyresson
- Can I use CASL?