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
I'm trying to use NewAdapterWithClient so that I can use the same client for the enforcer (i.e. for casbin_rules table) and for other tables of my project, it would be nice because I can then perhaps wrap the modification to casbin_rules and other tables in the same transaction. For example, when deleting a role, not only do I want to delete policies related to this role stored in casbin_rules, I want to delete info about this role stored in other tables. It's better if they can be done in a single transaction.
But, it's not letting me use my own ent client because it comes from my own ent package, instead of ent package from your repo.
I'm not exactly sure how to fix this, maybe instead of using the ent.client struct as the parameter of NewAdapterWithClient, we could use an interface instead?
I'm not sure wether this repo is still under maintenance or not. Though thank you for this anyway.
The text was updated successfully, but these errors were encountered:
Hi @Jubilee101 and any others looking for a solution on this issue. There is an idea showing in #25. It is generally working but may not be merged. You can customize your own adapter based on it and I will keep the fork available.
Hey @MuZhou233 Thank you so much for this. I'm not doing a personal project so I'm not quite sure if the license allows me to use a fork this way. But this is great idea and really nice work. I do hope it gets merged in the next release... if there is one.
Hi,
I'm trying to use NewAdapterWithClient so that I can use the same client for the enforcer (i.e. for casbin_rules table) and for other tables of my project, it would be nice because I can then perhaps wrap the modification to casbin_rules and other tables in the same transaction. For example, when deleting a role, not only do I want to delete policies related to this role stored in casbin_rules, I want to delete info about this role stored in other tables. It's better if they can be done in a single transaction.
But, it's not letting me use my own ent client because it comes from my own ent package, instead of ent package from your repo.
I'm not exactly sure how to fix this, maybe instead of using the ent.client struct as the parameter of NewAdapterWithClient, we could use an interface instead?
I'm not sure wether this repo is still under maintenance or not. Though thank you for this anyway.
The text was updated successfully, but these errors were encountered: