27 references to Requirements
BasicWebSite (1)
ConfigureAuthPolicies.cs (1)
28policy.Requirements.Add(Operations.Edit);
Microsoft.AspNetCore.Authorization (11)
AuthorizationPolicyBuilder.cs (11)
45/// Gets or sets a list authentication schemes the <see cref="AuthorizationPolicyBuilder.Requirements"/> 72/// <see cref="AuthorizationPolicyBuilder.Requirements"/> for this instance. 82Requirements.Add(req); 126Requirements.Add(new ClaimsAuthorizationRequirement(claimType, allowedValues)); 140Requirements.Add(new ClaimsAuthorizationRequirement(claimType, allowedValues: null)); 167Requirements.Add(new RolesAuthorizationRequirement(roles)); 180Requirements.Add(new NameAuthorizationRequirement(userName)); 190Requirements.Add(_denyAnonymousAuthorizationRequirement); 203Requirements.Add(new AssertionRequirement(handler)); 216Requirements.Add(new AssertionRequirement(handler)); 229return new AuthorizationPolicy(Requirements, AuthenticationSchemes.Distinct());
Microsoft.AspNetCore.Authorization.Test (13)
AuthorizationEndpointConventionBuilderExtensionsTests.cs (2)
151builder.RequireAuthorization(policyBuilder => policyBuilder.Requirements.Add(requirement)); 177builder.RequireAuthorization(policyBuilder => policyBuilder.Requirements.Add(requirement));
DefaultAuthorizationServiceTests.cs (10)
103services.AddAuthorizationBuilder().AddPolicy("Custom", policy => policy.Requirements.Add(new CustomRequirement())); 129.AddPolicy("Custom", policy => policy.Requirements.Add(new CustomRequirement())) 181services.AddAuthorizationBuilder().AddPolicy("Custom", policy => policy.Requirements.Add(new CustomRequirement())); 643options.AddPolicy("Custom", policy => policy.Requirements.Add(new CustomRequirement())); 664options.AddPolicy("Custom", policy => policy.Requirements.Add(new CustomRequirement())); 705options.AddPolicy("Passthrough", policy => policy.Requirements.Add(new PassThroughRequirement(shouldSucceed))); 1203p.Requirements.Add(new LogRequirement()); 1204p.Requirements.Add(new LogRequirement()); 1237p.Requirements.Add(new LogRequirement()); 1238p.Requirements.Add(new LogRequirement());
PassThroughAuthorizationHandlerTests.cs (1)
35options.AddPolicy("Self", policy => policy.Requirements.Add(willFail));
Microsoft.AspNetCore.Http.Connections.Tests (1)
MapConnectionHandlerTests.cs (1)
41endpoints => endpoints.RequireAuthorization(policy1).RequireAuthorization(pb => pb.Requirements.Add(req))))
Microsoft.AspNetCore.SignalR.Tests (1)
HubConnectionHandlerTests.cs (1)
3732policy.Requirements.Add(new DelayRequirement(tcsService));