Closed csmcgee closed 3 years ago
After reviewing this more with other devs. I have found that really if this MongoAdapter is meant to be a FilteredAdapter
then maybe we should consider implementing FilteredAdapter
casbin source interface.
So instead of
MongoAdapter implements Adapter
it should be
MongoAdapter implements FilteredAdapter
then adjust to that interface accordingly.
@juicycleff
Any news on that?
@sapcik It seems that the developer is inactive for some time. You can take a look at theother 2 MongoDB adapters at: https://casbin.org/docs/en/adapters
True, I am getting the issue of auto-save not working for deleted policies. it forces me to use enforcer.savePolicy() method to push all the policies to MongoDB which takes a lot of time to process. The expectation was to get deleted policies auto-saved with Cabin 5.0.1.
WIth Casbin 5.0.3 Exactly same issue - "this.adapter.isFiltered is not a function" is showing while using enforcer.savePolicy()
Due to this reason, I am completely blocked. Cannot use this adapter as this is not getting updated with the latest casbin. As said above Developer is inactive now. Need to switch to a different adapter.
ping @juicycleff
@alokadhao20 are you claiming the same issue about FilteredAdapter
? If not, please send a new issue.
Yes @hsluoyz
@juicycleff @alokadhao20 @csmcgee
isFiltered in a function in casbin-filter This is simply because isFiltered is overwrited in https://github.com/juicycleff/casbin-mongodb-adapter/blob/master/src/lib/adapter.ts#L60
Hi all, I am looking at fixing this today. Will make an update at the end of today
Hi all, I am looking at fixing this today. Will make an update at the end of today
Please see https://github.com/juicycleff/casbin-mongodb-adapter/pull/10
I was attempting to use the RBAC management api and noticed that the delete was not persisting (autosave I guess doesn't work for
deleteUser
). So I attempted to usesavePolicy
and got the following error:Diving deeper I noticed that node-casbin expects
isFiltered
to be a function see https://github.com/casbin/node-casbin/blob/master/src/coreEnforcer.ts#L184.Current state of
isFiltered
in the adapter.Workaround for those interested:
I'm not currently using filtered yet... so I'm not sure how useful this will be to anyone.