11 references to RequireRole
Microsoft.AspNetCore.Authorization.Test (10)
AuthorizationMiddlewareTests.cs (4)
705var policy = new AuthorizationPolicyBuilder().RequireRole("Wut").Build(); 727var policy = new AuthorizationPolicyBuilder().RequireRole("Wut").AddAuthenticationSchemes("Basic", "Bearer").Build(); 795var policy = new AuthorizationPolicyBuilder().RequireRole("Wut").AddAuthenticationSchemes("NotImplemented").Build(); 818var policy = new AuthorizationPolicyBuilder().RequireRole("Wut").AddAuthenticationSchemes("Basic", "Bearer").Build();
AuthorizationPolicyFacts.cs (1)
14Assert.Throws<InvalidOperationException>(() => new AuthorizationPolicyBuilder().RequireRole());
DefaultAuthorizationServiceTests.cs (5)
348var policy = new AuthorizationPolicyBuilder().RequireRole("Administrator") 409var policy = new AuthorizationPolicyBuilder("AuthType").RequireRole("Admin"); 426var policy = new AuthorizationPolicyBuilder("AuthType").RequireRole("Admin", "Users"); 464services.AddAuthorizationBuilder().AddPolicy("Basic", policy => policy.RequireRole("Admin", "Users"))); 563options.AddPolicy("Hao", policy => policy.RequireRole("Hao"));
Microsoft.AspNetCore.Mvc.Core.Test (1)
Authorization\AuthorizeFilterTest.cs (1)
391var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireRole("Wut").Build());