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