public CasbinEvaluatorTest(TestServerFixture testServerFixture) { _serviceProvider = testServerFixture.TestServer.Services; _casbinPolicyCreator = _serviceProvider.GetRequiredService <ICasbinPolicyCreator>(); _casbinAuthorizationContextFactory = _serviceProvider.GetRequiredService <ICasbinAuthorizationContextFactory>(); }
public CasbinAuthorizationMiddleware(RequestDelegate next, ICasbinPolicyCreator policyCreator) { _next = next ?? throw new ArgumentNullException(nameof(next)); _policyCreator = policyCreator ?? throw new ArgumentNullException(nameof(policyCreator));; }