13 references to Operations
Microsoft.AspNetCore.Authorization.Test (13)
DefaultAuthorizationServiceTests.cs (13)
845services.AddSingleton<IAuthorizationHandler>(new ExpenseReportAuthorizationHandler(new OperationAuthorizationRequirement[] { Operations.Edit }));
858Assert.True((await authorizationService.AuthorizeAsync(user, null, Operations.Edit)).Succeeded);
859Assert.True((await authorizationService.AuthorizeAsync(user, null, Operations.Delete)).Succeeded);
860Assert.True((await authorizationService.AuthorizeAsync(user, null, Operations.Create)).Succeeded);
900Assert.False((await authorizationService.AuthorizeAsync(user, 1, Operations.Edit)).Succeeded);
901Assert.True((await authorizationService.AuthorizeAsync(user, 2, Operations.Edit)).Succeeded);
922Assert.False((await authorizationService.AuthorizeAsync(user, 1, Operations.Edit)).Succeeded);
931services.AddSingleton<IAuthorizationHandler>(new ExpenseReportAuthorizationHandler(new OperationAuthorizationRequirement[] { Operations.Edit }));
937Assert.True((await authorizationService.AuthorizeAsync(user, new ExpenseReport(), Operations.Edit)).Succeeded);
938Assert.False((await authorizationService.AuthorizeAsync(user, new ExpenseReport(), Operations.Delete)).Succeeded);
939Assert.False((await authorizationService.AuthorizeAsync(user, new ExpenseReport(), Operations.Create)).Succeeded);
948services.AddSingleton<IAuthorizationHandler>(new ExpenseReportAuthorizationHandler(new OperationAuthorizationRequirement[] { Operations.Edit }));
954Assert.False((await authorizationService.AuthorizeAsync(user, null, Operations.Edit)).Succeeded);