GithubHelp home page GithubHelp logo

Comments (9)

hsluoyz avatar hsluoyz commented on August 24, 2024 1

Hi @AnandChowdhary @MP70 I'm from Casbin team. We have made a Prisma adapter these days: https://github.com/node-casbin/prisma-adapter . Can you try it?

from api.

issue-label-bot avatar issue-label-bot commented on August 24, 2024

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.57. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

from api.

MP70 avatar MP70 commented on August 24, 2024

Taking another look, perhaps using casbin (https://github.com/casbin/node-casbin) preferably or https://github.com/onury/accesscontrol#guide as a framework for managing this RBAC is a more flexible approach?

from api.

AnandChowdhary avatar AnandChowdhary commented on August 24, 2024

@mattpi-NSL, using Casbin is a great idea! It's far superior to the current hard-coded authorization helper, and it's much more scalable and customizable. Let's put this on the project!

from api.

MP70 avatar MP70 commented on August 24, 2024

I have taken a look a bit further down this path. For now in my branch I am using Postgres for the database, I notice this master branch is now using Prisma. Casbin has adapters for Knex/Sequelize/TypeORM as SQL ORMs as well as for psql and mysql however it doesn't have one for prisma. I think this may mean that we need to write an adapter for Prisma or (re)use Redis for this.

from api.

MP70 avatar MP70 commented on August 24, 2024

Wow! Thank you so much, this is incredible! My fork has diverged quite a lot from this and I am using different set of technologies, so I will leave this to @AnandChowdhary for now, however if he doesn't get to it first, then as soon as I have some free time I will definitely take a look at this!

from api.

AnandChowdhary avatar AnandChowdhary commented on August 24, 2024

Can you try it?

This looks great, thanks for all your hard work, @hsluoyz! I'll definitely have a look at this, because now it fits right into our Prisma-led database framework and would be much easier to adopt.

from api.

AnandChowdhary avatar AnandChowdhary commented on August 24, 2024

Good news! After many months, this is now shipped in master! 😄

Default policy model: https://github.com/staart/api/blob/master/casbin-model.conf
Updated authorization helper, built with Casbin: https://github.com/staart/api/blob/master/src/_staart/helpers/authorization.ts

from api.

hsluoyz avatar hsluoyz commented on August 24, 2024

Thanks! It's great work!

from api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.