Is Orchid capable of implementing RBAC/ACL? #243
-
One thing that I haven't found any info about (and that may be because Orchid is still a very young tool) is how to implement Role Based Access Control (RBAC) or Access Control List (ACL). Specifically, I'm looking for ways to handle authentication and authorisation in my app using Orchid, for example with Auth.js (formerly known as Next-Auth) or Clerk, but I'm not sure where to even start. There are plenty of tutorials and adapters for ORMs such as TypeORM or Drizzle, but nothing for Orchid. Would you @romeerez or anyone in the community have any ideas on how to tackle RBAC/authentication using Orchid with some basic examples? I'd appreciate any help, even if just a few pointers or links to things others have done in that area. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
That's right, the auth topic wasn't mentioned in the issues before this, and there is nothing specific for it in Orchid ORM. For third-party providers such as Clerk, it should be simple enough. For Auth0 I just stored user_id and called it a day, nothing else isn't required to be stored, and RBAC is handled completely by the third party. Regarding Auth.js (Next-Auth) - why not, it's a good idea to maintain integration with an open-source project. I looked at the drizzle integration with Auth.js and it doesn't seem like a big problem to implement. But only if you're going to use Next-Auth, it's not worth building an integration for Auth.js if it's not going to be used by anybody in the near future and you'll go with Clerk. You can implement it without waiting for additional features, RBAC is basically a few tables with relations, and Orchid ORM is capable of handling tables and relations. |
Beta Was this translation helpful? Give feedback.
That's right, the auth topic wasn't mentioned in the issues before this, and there is nothing specific for it in Orchid ORM.
For third-party providers such as Clerk, it should be simple enough. For Auth0 I just stored user_id and called it a day, nothing else isn't required to be stored, and RBAC is handled completely by the third party.
Regarding Auth.js (Next-Auth) - why not, it's a good idea to maintain integration with an open-source project. I looked at the drizzle integration with Auth.js and it doesn't seem like a big problem to implement. But only if you're going to use Next-Auth, it's not worth building an integration for Auth.js if it's not going to be used by anybody in the nea…