Casbin Forum runs on Casnode, the open-source Discourse-style forum. Try the Casnode demo →
Casbin Forum

Hi guys, I am trying to use casbin with prism adapter, but when I run the initWithAdapter method it throws me an error saying casbinRule is not defined.

await this.enforcer.initWithAdapter(
     path.resolve(__dirname, 'config/rbac_model.conf'),
     this.adapter,
   );

error

TypeError: Cannot read properties of undefined (reading 'casbinRule')

I have run npx prism generate, and I have also run the migrations
here the example code

https://codeshare.io/RaVKOG

what did I miss ?

1views
2users
1 minread
1 / 2
Apr 2025