From 575ff2598381750812d659eaede21ce8c26dbc65 Mon Sep 17 00:00:00 2001 From: "Atsuta, Ivan" Date: Mon, 18 Nov 2024 12:12:33 +0100 Subject: [PATCH] upd --- .../SampleSystemSecuritySystemExtensions.cs | 3 ++- .../SampleSystem.IntegrationTests/BusinessUnitTests.cs | 2 +- .../DependencySecurityTests.cs | 6 ++++-- .../ExtraQueryableSecurityPathTests.cs | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/_SampleSystem/SampleSystem.Security/SampleSystemSecuritySystemExtensions.cs b/src/_SampleSystem/SampleSystem.Security/SampleSystemSecuritySystemExtensions.cs index a3dfda271..3437efdec 100644 --- a/src/_SampleSystem/SampleSystem.Security/SampleSystemSecuritySystemExtensions.cs +++ b/src/_SampleSystem/SampleSystem.Security/SampleSystemSecuritySystemExtensions.cs @@ -31,7 +31,8 @@ public static ISecuritySystemSettings AddSecurityRoles(this ISecuritySystemSetti SampleSystemSecurityRole.SeManager, new SecurityRoleInfo(new Guid("dbf3556d-7106-4175-b5e4-a32d00bd857a")) { - Children = [SampleSystemSecurityRole.TestVirtualRole] + Children = [SampleSystemSecurityRole.TestVirtualRole], + Operations = [SampleSystemSecurityOperation.BusinessUnitEdit] }) .AddSecurityRole( diff --git a/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/BusinessUnitTests.cs b/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/BusinessUnitTests.cs index 57d9d1e73..b23b8528f 100644 --- a/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/BusinessUnitTests.cs +++ b/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/BusinessUnitTests.cs @@ -122,7 +122,7 @@ public void LoadTreeWithMiddlePermission_RootParentLoadedWithViewMode() var userId = this.AuthHelper.SetUserRole( TextRandomizer.RandomString(10), - new SampleSystemTestPermission(SecurityRole.Administrator, childBu)); + new SampleSystemTestPermission(SampleSystemSecurityRole.SeManager, childBu)); // Act var result = this.Evaluate( diff --git a/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/DependencySecurityTests.cs b/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/DependencySecurityTests.cs index 5b5e7d603..dfee75f4a 100644 --- a/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/DependencySecurityTests.cs +++ b/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/DependencySecurityTests.cs @@ -1,4 +1,5 @@ -using Automation.ServiceEnvironment; + +using Automation.ServiceEnvironment; using FluentAssertions; @@ -9,6 +10,7 @@ using SampleSystem.Domain; using SampleSystem.Generated.DTO; using SampleSystem.IntegrationTests.__Support.TestData; +using SampleSystem.Security; using SampleSystem.WebApiCore.Controllers.Main; namespace SampleSystem.IntegrationTests; @@ -45,7 +47,7 @@ public void SetUp() this.DataHelper.SaveEmployee(login: TestEmployeeLogin); - this.AuthHelper.SetUserRole(TestEmployeeLogin, new SampleSystemTestPermission(SecurityRole.Administrator, this.bu2Ident, null, null)); + this.AuthHelper.SetUserRole(TestEmployeeLogin, new SampleSystemTestPermission(SampleSystemSecurityRole.SeManager, this.bu2Ident)); this.EvaluateWrite( context => diff --git a/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/ExtraQueryableSecurityPathTests.cs b/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/ExtraQueryableSecurityPathTests.cs index a6498c8cb..51e1dc573 100644 --- a/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/ExtraQueryableSecurityPathTests.cs +++ b/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/ExtraQueryableSecurityPathTests.cs @@ -50,8 +50,8 @@ public void SetUp() this.AuthHelper.SetUserRole( this.TestEmployee.Id, - new SampleSystemTestPermission(SecurityRole.Administrator, this.bu2Ident, null, this.loc1Ident), - new SampleSystemTestPermission(SecurityRole.Administrator, this.bu2Ident, null, this.loc2Ident)); + new SampleSystemTestPermission(SampleSystemSecurityRole.SeManager, this.bu2Ident, null, this.loc1Ident), + new SampleSystemTestPermission(SampleSystemSecurityRole.SeManager, this.bu2Ident, null, this.loc2Ident)); this.TestEmp1 = this.DataHelper.SaveEmployee(coreBusinessUnit: this.bu1Ident, location: this.loc1Ident);