private static async Task AssertRolesAffectSuccess(ClaimsPrincipal user, IEnumerable <string> allowedRoles, bool shouldSucceed)
        {
            var requirement = new RolesAuthorizationRequirement(allowedRoles);
            var context     = new AuthorizationHandlerContext(new [] { requirement }, user, null);
            await requirement.HandleAsync(context);

            Assert.AreEqual(shouldSucceed, context.HasSucceeded);
        }
 public async Task HandleProtectedAsync(AuthorizationHandlerContext context, RolesAuthorizationRequirement requirement)
 {
     await HandleRequirementAsync(context, requirement);
 }
 public void HandleProtected(AuthorizationContext context, RolesAuthorizationRequirement requirement)
 {
     Handle(context, requirement);
 }