After upgrading to Casbin.AspNetCore v0.2.0 It seems the overrides specified in services.AddCasbinAuthorization() does not have an effect.
Using the code below I have not been able to verify that the DefaultEnforcerFactory lambda is called, or that the VerjiRbacTenantRequestTransformer() is ever called.
services.AddCasbinAuthorization(options =>
{
options.PreferSubClaimType = "sub";
options.DefaultModelPath = Path.Combine(@"AccessControl\CasbinConfigs", "basic_rest_domain_model.conf");
options.DefaultPolicyPath = Path.Combine(@"AccessControl\CasbinConfigs", "basic_rest_domain_policy.csv");
// Comment line below to use the default BasicRequestTransformer
// Note: Commenting the line means that the action methods MUST have [CasbinAuthorize()] attribute which explicitly specifies obj and policy. Otherwise authorization will be denied
options.DefaultRequestTransformer = new VerjiRbacTenantRequestTransformer();
options.DefaultEnforcerFactory = (svc, model) =>
{
var context = svc.GetRequiredService<VerjiCasbinDbContext>();
var adapter = new EFCoreAdapter<Guid>(context);
return new Enforcer(model, adapter);
};
});
Did anything change in v0.2.0 so this must be done differently?
PS: I'm consuming the packages from nuget.org (and not myget.org/casbin)
After upgrading to Casbin.AspNetCore v0.2.0 It seems the overrides specified in services.AddCasbinAuthorization() does not have an effect.
Using the code below I have not been able to verify that the
DefaultEnforcerFactory
lambda is called, or that theVerjiRbacTenantRequestTransformer()
is ever called.Did anything change in v0.2.0 so this must be done differently?
PS: I'm consuming the packages from nuget.org (and not myget.org/casbin)