casbin / node-casbin

An authorization library that supports access control models like ACL, RBAC, ABAC in Node.js and Browser
https://casbin.org
Apache License 2.0
2.58k stars 216 forks source link

Casbin Watcher for Prisma ORM #455

Closed Sedhupathi1411 closed 1 year ago

Sedhupathi1411 commented 1 year ago

I'm using Casbin with Prisma adaptor in my server (ExpressJS) code. When I run multiple instances of the server, changes made my one instance is unaware on another instance.

By this comment, I came to know I have to add Watchers. But there are none for Prisma.

Techs I'm using --> ExpressJS + Typescript + Casbin + Prisma ORM + PostgreSQL

Could you guys please help me?

casbin-bot commented 1 year ago

@nodece @Shivansh-yadav13

hsluoyz commented 1 year ago

@Sedhupathi1411 AFAIK, Prisma is a ORM, not a messaging system. Can a watcher be made from it?

You should take a look at existing watchers: https://github.com/node-casbin?q=watcher&type=all&language=&sort=

Sedhupathi1411 commented 1 year ago

No, prisma1 supported it, but prisma2+removed it (now it's version is 5x) There's none for PostgreSQL in the watchers list you sent.

I found this (https://github.com/mcollina/casbin-pg-watcher) from the Casbin website. This might work for me.

Thank you for responding.

hsluoyz commented 1 year ago

@Sedhupathi1411 yes, please try that one: https://github.com/mcollina/casbin-pg-watcher

Closed here for now