2 instantiations of RolesAuthorizationRequirement
Microsoft.AspNetCore.Authorization (1)
AuthorizationPolicyBuilder.cs (1)
167Requirements.Add(new RolesAuthorizationRequirement(roles));
Microsoft.AspNetCore.Authorization.Test (1)
RolesAuthorizationRequirementTests.cs (1)
12return new RolesAuthorizationRequirement(allowedRoles);
17 references to RolesAuthorizationRequirement
Microsoft.AspNetCore.Authorization (6)
AuthorizationPolicyBuilder.cs (2)
145/// Adds a <see cref="RolesAuthorizationRequirement"/> to the current instance which enforces that the current user 158/// Adds a <see cref="RolesAuthorizationRequirement"/> to the current instance which enforces that the current user
RolesAuthorizationRequirement.cs (4)
16public class RolesAuthorizationRequirement : AuthorizationHandler<RolesAuthorizationRequirement>, IAuthorizationRequirement 19/// Creates a new instance of <see cref="RolesAuthorizationRequirement"/>. 43protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, RolesAuthorizationRequirement requirement) 71return $"{nameof(RolesAuthorizationRequirement)}:{roles}";
Microsoft.AspNetCore.Authorization.Test (10)
AuthorizationPolicyFacts.cs (7)
43Assert.Single(combined.Requirements.OfType<RolesAuthorizationRequirement>()); 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();
RolesAuthorizationRequirementTests.cs (3)
10private RolesAuthorizationRequirement CreateRequirement(params string[] allowedRoles) 19var requirement = CreateRequirement("Custom1", "Custom2"); 32var requirement = CreateRequirement("Custom1");
Microsoft.AspNetCore.Components.Authorization.Tests (1)
AuthorizeViewTest.cs (1)
450((RolesAuthorizationRequirement)req).AllowedRoles));