diff --git a/src/Framework.SecuritySystem.Abstract/SecurityPath/SecurityPathRestriction.cs b/src/Framework.SecuritySystem.Abstract/SecurityPath/SecurityPathRestriction.cs index 0e156865..765273a7 100644 --- a/src/Framework.SecuritySystem.Abstract/SecurityPath/SecurityPathRestriction.cs +++ b/src/Framework.SecuritySystem.Abstract/SecurityPath/SecurityPathRestriction.cs @@ -22,7 +22,9 @@ public SecurityPathRestriction( public IEnumerable? SecurityContextTypes => this.SecurityContextRestrictions?.Select(v => v.Type); - public static SecurityPathRestriction Empty { get; } = new(null, Array.Empty(), []); + public static SecurityPathRestriction Disabled { get; } = new(null, Array.Empty(), []); + + public static SecurityPathRestriction Empty { get; } = new([], Array.Empty(), []); public SecurityPathRestriction Add(bool required = false, string? key = null) where TSecurityContext : ISecurityContext => @@ -43,8 +45,8 @@ public SecurityPathRestriction AddConditionFactory(Type conditionFactoryType) => new(this.SecurityContextRestrictions, this.ConditionFactoryTypes.Concat([conditionFactoryType]), this.RelativeConditions); public static SecurityPathRestriction Create(bool required = false, string? key = null) - where TSecurityContext : ISecurityContext => Empty.Add(required, key); + where TSecurityContext : ISecurityContext => Disabled.Add(required, key); public static SecurityPathRestriction Create(Expression> condition) => - Empty.AddRelativeCondition(condition); + Disabled.AddRelativeCondition(condition); } diff --git a/src/Framework.SecuritySystem.Abstract/SecurityRole/SecurityRoleInfo.cs b/src/Framework.SecuritySystem.Abstract/SecurityRole/SecurityRoleInfo.cs index 76e0de44..66e56c9c 100644 --- a/src/Framework.SecuritySystem.Abstract/SecurityRole/SecurityRoleInfo.cs +++ b/src/Framework.SecuritySystem.Abstract/SecurityRole/SecurityRoleInfo.cs @@ -6,7 +6,7 @@ public record SecurityRoleInfo(Guid Id) { public HierarchicalExpandType? CustomExpandType { get; init; } = null; - public SecurityPathRestriction Restriction { get; init; } = SecurityPathRestriction.Empty; + public SecurityPathRestriction Restriction { get; init; } = SecurityPathRestriction.Disabled; public IReadOnlyList Operations { get; init; } = []; diff --git a/src/Framework.SecuritySystem.DiTests/SecurityPathTests.cs b/src/Framework.SecuritySystem.DiTests/SecurityPathTests.cs index c55bcef4..a0bfac1d 100644 --- a/src/Framework.SecuritySystem.DiTests/SecurityPathTests.cs +++ b/src/Framework.SecuritySystem.DiTests/SecurityPathTests.cs @@ -102,7 +102,7 @@ public void EmptySecurityPathRestriction_SecurityPathNotModified() var testSecurityPath = baseSecurityPath.And(altSecurityPath); - var restriction = SecurityPathRestriction.Empty; + var restriction = SecurityPathRestriction.Disabled; //Act var result = service.ApplyRestriction(testSecurityPath, restriction); diff --git a/src/_SampleSystem/SampleSystem.Security/SampleSystemSecuritySystemExtensions.cs b/src/_SampleSystem/SampleSystem.Security/SampleSystemSecuritySystemExtensions.cs index c28c6f06..1ee671d6 100644 --- a/src/_SampleSystem/SampleSystem.Security/SampleSystemSecuritySystemExtensions.cs +++ b/src/_SampleSystem/SampleSystem.Security/SampleSystemSecuritySystemExtensions.cs @@ -99,7 +99,8 @@ public static ISecuritySystemSettings AddSecurityRoles(this ISecuritySystemSetti SecurityRole.Administrator, new SecurityRoleInfo(new Guid("d9c1d2f0-0c2f-49ab-bb0b-de13a456169e")) { - Operations = typeof(SampleSystemSecurityOperation).GetStaticPropertyValueList().ToList() + Operations = typeof(SampleSystemSecurityOperation).GetStaticPropertyValueList().ToList(), + Restriction = SecurityPathRestriction.Empty }); } diff --git a/src/__SolutionItems/CommonAssemblyInfo.cs b/src/__SolutionItems/CommonAssemblyInfo.cs index 71f64480..6eb991eb 100644 --- a/src/__SolutionItems/CommonAssemblyInfo.cs +++ b/src/__SolutionItems/CommonAssemblyInfo.cs @@ -4,9 +4,9 @@ [assembly: AssemblyCompany("Luxoft")] [assembly: AssemblyCopyright("Copyright © Luxoft 2009-2024")] -[assembly: AssemblyVersion("22.5.5.0")] -[assembly: AssemblyFileVersion("22.5.5.0")] -[assembly: AssemblyInformationalVersion("22.5.5.0")] +[assembly: AssemblyVersion("22.5.6.0")] +[assembly: AssemblyFileVersion("22.5.6.0")] +[assembly: AssemblyInformationalVersion("22.5.6.0")] #if DEBUG [assembly: AssemblyConfiguration("Debug")]