Saxonite 1.2.11.12

This commit is contained in:
Andy Howard
2024-08-20 17:51:51 +01:00
parent 12aa285f32
commit 2eb778ac17
36 changed files with 149 additions and 121 deletions
@@ -257,12 +257,11 @@ namespace Sarand.Net.Standard.Base.Security
public Data GetData () { return data.Clone(); }
public void SetData (Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if ((int)data.ItemType > 0 && data.ItemType != ItemType)
throw new NotSupportedException(fn + " Item Type cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Item Type cannot be changed");
// Populate individual properties to ensure that 'Changed' indicator is kept up to date.
this.data.PopulateFrom(data);
}
@@ -371,8 +370,6 @@ namespace Sarand.Net.Standard.Base.Security
}
public static String EncryptPassword (String password)
{
//String fn = "SaSecurityItem.EncryptPassword";
// We know this is not very water-tight, but it at least
// hides the contents of the password from prying eyes.
String toBeEncrypted = password;
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Utils;
namespace Sarand.Net.Standard.Base.Security
{
@@ -165,14 +166,13 @@ namespace Sarand.Net.Standard.Base.Security
public Data GetData () { return data.Clone(); }
public void SetData (Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(data.Id))
throw new NotSupportedException(fn + " Id is not applicable for security links");
throw new NotSupportedException($"{SysUtil.Fn} Id is not applicable for security links");
if (SysId.IsValid(data.ItemIdOwner) && SysId.ToInt(data.ItemIdOwner) != SysId.ToInt(ItemIdOwner))
throw new NotSupportedException(fn + " Owner Item cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Owner Item cannot be changed");
if (SysId.IsValid(data.ItemIdTarget) && SysId.ToInt(data.ItemIdTarget) != SysId.ToInt(ItemIdTarget))
throw new NotSupportedException(fn + " Target Item cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Target Item cannot be changed");
// Populate individual properties to ensure that 'Changed' indicator is kept up to date.
this.data.PopulateFrom(data);
}