You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a FilteredAdapter with MongooseAdapter.newFilteredAdapter(config.db) it is expected to stay as FilteredAdapter. However current behaviour is that it changes dynamically during execution
When creating a
FilteredAdapter
withMongooseAdapter.newFilteredAdapter(config.db)
it is expected to stay as FilteredAdapter. However current behaviour is that it changes dynamically during executioncasbin-mongoose-adapter/src/adapter.js
Line 141 in 4a87b7a
Now the problem is that when a filtered adapter is first created casbin internally calls
loadPolicy(model)
casbin-mongoose-adapter/src/adapter.js
Line 126 in 4a87b7a
which switches it back to an ordinary adapter. Then if a user calls
enforcer.loadFilteredPolicy()
casbin throws an error, as it does not recognize the adapter to be filtered anymorehttps://github.com/casbin/node-casbin/blob/40dd90a6dd7a023746bc3c15593d96d802c612ab/src/coreEnforcer.ts#L164
I think
loadPolicy()
should work without changing the adapter type.The text was updated successfully, but these errors were encountered: