casbin-net / casbin-aspnetcore

Casbin.NET integration middleware and sample code for ASP.NET Core
https://github.com/casbin/Casbin.NET
Apache License 2.0
64 stars 20 forks source link

Missing compatibility with Casbin EFCore Adapter #41

Closed shayura closed 1 year ago

shayura commented 2 years ago

As it stands now, the only implementation of IEnforcerProvider inside this package, i.e. DefaultEnforcerProvider, does not integrate with Casbin EFCore Adapter.

Would you consider adding a ICasbinAuthorizationPolicyProvider compatible with the EFCore Adapter?

casbin-bot commented 2 years ago

@sagilio @xcaptain @huazhikui

gsw945 commented 1 year ago

same question +1

hsluoyz commented 1 year ago

@AsakusaRinne @sagilio

sagilio commented 1 year ago

@gsw945 @shayura You can refer to this to integrate the adapter on the current version.

We are trying a friendlier way to integrate it, like this: https://github.com/casbin-net/casbin-aspnetcore/blob/e73d261e15580d120e19da99ddc9c13bb2a30389/src/Casbin.AspNetCore.Core/DefaultEnforcerProvider.cs#L53-L58

hsluoyz commented 1 year ago

@AsakusaRinne plz work on this

AsakusaRinne commented 1 year ago

@AsakusaRinne plz work on this

It's on process now. I would submit a PR depending on this PR for efcore-adapter

AsakusaRinne commented 1 year ago

@shayura We have added a sample which integrates it with efcore-adapter (in samples/WebApplicationWithEfcoreSample). Does it get the point of what you need?

hsluoyz commented 1 year ago

Closed as resolved