1 write to Requirements
Microsoft.AspNetCore.Authorization (1)
AuthorizationPolicy.cs (1)
38Requirements = new List<IAuthorizationRequirement>(requirements).AsReadOnly();
32 references to Requirements
Microsoft.AspNetCore.Authorization (3)
AuthorizationPolicy.cs (1)
49/// Gets a readonly list of the authentication schemes the <see cref="AuthorizationPolicy.Requirements"/>
AuthorizationPolicyBuilder.cs (1)
97AddRequirementsCore(policy.Requirements);
AuthorizationServiceExtensions.cs (1)
51return service.AuthorizeAsync(user, resource, policy.Requirements);
Microsoft.AspNetCore.Authorization.Test (19)
AuthorizationBuilderTests.cs (2)
102Assert.Single(policy.Requirements); 103Assert.IsType<AssertionRequirement>(policy.Requirements.First());
AuthorizationEndpointConventionBuilderExtensionsTests.cs (4)
164Assert.Single(policy.Requirements); 165Assert.Equal(requirement, policy.Requirements[0]); 190Assert.Single(policy.Requirements); 191Assert.Equal(requirement, policy.Requirements[0]);
AuthorizationPolicyFacts.cs (13)
40Assert.Equal(4, combined.Requirements.Count()); 41Assert.Contains(combined.Requirements, r => r is DenyAnonymousAuthorizationRequirement); 42Assert.Equal(2, combined.Requirements.OfType<ClaimsAuthorizationRequirement>().Count()); 43Assert.Single(combined.Requirements.OfType<RolesAuthorizationRequirement>()); 65Assert.Single(combined.Requirements); 66Assert.Empty(combined.Requirements.OfType<DenyAnonymousAuthorizationRequirement>()); 90Assert.Equal(2, combined.Requirements.Count()); 91Assert.DoesNotContain(combined.Requirements, r => r is DenyAnonymousAuthorizationRequirement); 92Assert.Equal(2, combined.Requirements.OfType<ClaimsAuthorizationRequirement>().Count()); 109Assert.Contains(combined.Requirements, r => r is RolesAuthorizationRequirement); 110var rolesAuthorizationRequirement = combined.Requirements.OfType<RolesAuthorizationRequirement>().First(); 170Assert.Contains(combined.Requirements, r => r is RolesAuthorizationRequirement); 171var rolesAuthorizationRequirement = combined.Requirements.OfType<RolesAuthorizationRequirement>().First();
Microsoft.AspNetCore.Http.Connections.Tests (4)
MapConnectionHandlerTests.cs (4)
55Assert.Single(policies[1].Requirements); 56Assert.Equal(req, policies[1].Requirements.First()); 65Assert.Single(policies[1].Requirements); 66Assert.Equal(req, policies[1].Requirements.First());
Microsoft.AspNetCore.Mvc.Core.Test (1)
ApplicationModels\AuthorizationApplicationModelProviderTest.cs (1)
99Assert.Equal(3, authorizeFilters.First().Policy.Requirements.Count()); // Basic + Basic2 + Derived authorize
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
ApplicationModels\AuthorizationPageApplicationModelProviderTest.cs (1)
131Assert.Equal(3, authorizeFilter.Policy.Requirements.Count);
Microsoft.AspNetCore.SignalR.Tests (4)
MapSignalRTests.cs (4)
127Assert.Single(policies[1].Requirements); 128Assert.Equal(req, policies[1].Requirements.First()); 137Assert.Single(policies[1].Requirements); 138Assert.Equal(req, policies[1].Requirements.First());