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