Add integer data area type id

This commit is contained in:
Meik
2026-03-29 23:26:16 +02:00
parent cd133c67e1
commit 45009dfacc
3 changed files with 332 additions and 329 deletions

View File

@@ -373,6 +373,7 @@ namespace C4IT.LIAM
public string Description { get; set; } public string Description { get; set; }
public string UniqueId { get; set; } public string UniqueId { get; set; }
public string DataAreaType { get; set; } public string DataAreaType { get; set; }
public int DataAreaTypeId { get; set; }
} }
public class LiamApiVersionInfo public class LiamApiVersionInfo
{ {

View File

@@ -557,238 +557,238 @@ where ";
return RetVal; return RetVal;
} }
private bool TryLoadProviderFragments(Guid providerConfigClassID, out Guid objectId, out DataTable tblMain, out DataTable tblBase, out DataTable tblAdditionalAttr, out DataTable tblNamingConvention, out DataTable tblCustomTags) private bool TryLoadProviderFragments(Guid providerConfigClassID, out Guid objectId, out DataTable tblMain, out DataTable tblBase, out DataTable tblAdditionalAttr, out DataTable tblNamingConvention, out DataTable tblCustomTags)
{ {
objectId = Guid.Empty; objectId = Guid.Empty;
tblMain = null; tblMain = null;
tblBase = null; tblBase = null;
tblAdditionalAttr = null; tblAdditionalAttr = null;
tblNamingConvention = null; tblNamingConvention = null;
tblCustomTags = null; tblCustomTags = null;
try try
{ {
var classID = SPSDataEngineSchemaReader.ClassGetIDFromName(constFragmentNameConfigProviderMain); var classID = SPSDataEngineSchemaReader.ClassGetIDFromName(constFragmentNameConfigProviderMain);
LogEntry($"Config provider class ID: {classID}", LogLevels.Debug); LogEntry($"Config provider class ID: {classID}", LogLevels.Debug);
var fragment = FragmentRequest.GetSPSFragment(classID, providerConfigClassID); var fragment = FragmentRequest.GetSPSFragment(classID, providerConfigClassID);
if (fragment == null) if (fragment == null)
{ {
LogEntry($"Provider config fragment not found: ClassID={classID}, FragmentId={providerConfigClassID}", LogLevels.Debug); LogEntry($"Provider config fragment not found: ClassID={classID}, FragmentId={providerConfigClassID}", LogLevels.Debug);
return false; return false;
} }
objectId = fragment.ObjectID; objectId = fragment.ObjectID;
if (objectId == Guid.Empty) if (objectId == Guid.Empty)
{ {
LogEntry($"Provider config fragment not found: ClassID={classID}, FragmentId={providerConfigClassID}", LogLevels.Debug); LogEntry($"Provider config fragment not found: ClassID={classID}, FragmentId={providerConfigClassID}", LogLevels.Debug);
return false; return false;
} }
tblMain = fragment.FragmentTable; tblMain = fragment.FragmentTable;
LogEntry($"Config provider object ID: {objectId}", LogLevels.Debug); LogEntry($"Config provider object ID: {objectId}", LogLevels.Debug);
classID = SPSDataEngineSchemaReader.ClassGetIDFromName(constFragmentNameConfigProviderBase); classID = SPSDataEngineSchemaReader.ClassGetIDFromName(constFragmentNameConfigProviderBase);
LogEntry($"Config provider base class ID: {classID}", LogLevels.Debug); LogEntry($"Config provider base class ID: {classID}", LogLevels.Debug);
Guid[] ids = { objectId }; Guid[] ids = { objectId };
tblBase = FragmentRequestBase.SimpleLoad(classID, tblBase = FragmentRequestBase.SimpleLoad(classID,
"Account, Password", "Account, Password",
AsqlHelper.BuildInCondition("[Expression-ObjectID]", ids)); AsqlHelper.BuildInCondition("[Expression-ObjectID]", ids));
if (tblBase?.Rows == null || tblBase.Rows.Count <= 0) if (tblBase?.Rows == null || tblBase.Rows.Count <= 0)
{ {
LogEntry($"Provider config base fragment not found: ClassId={classID}, ObjectId={objectId}", LogLevels.Debug); LogEntry($"Provider config base fragment not found: ClassId={classID}, ObjectId={objectId}", LogLevels.Debug);
return false; return false;
} }
classID = SPSDataEngineSchemaReader.ClassGetIDFromName(constFragmentNameConfigProviderAdditionalAttributes); classID = SPSDataEngineSchemaReader.ClassGetIDFromName(constFragmentNameConfigProviderAdditionalAttributes);
LogEntry($"Config provider additional config class ID: {classID}", LogLevels.Debug); LogEntry($"Config provider additional config class ID: {classID}", LogLevels.Debug);
tblAdditionalAttr = FragmentRequestBase.SimpleLoad(classID, tblAdditionalAttr = FragmentRequestBase.SimpleLoad(classID,
"Name, Value", "Name, Value",
AsqlHelper.BuildInCondition("[Expression-ObjectID]", ids)); AsqlHelper.BuildInCondition("[Expression-ObjectID]", ids));
if (tblAdditionalAttr == null) if (tblAdditionalAttr == null)
{ {
LogEntry($"Provider additional config class fragment not found: ClassId={classID}, ObjectId={objectId}", LogLevels.Debug); LogEntry($"Provider additional config class fragment not found: ClassId={classID}, ObjectId={objectId}", LogLevels.Debug);
return false; return false;
} }
classID = SPSDataEngineSchemaReader.ClassGetIDFromName(constFragmentNameCustomTagBase); classID = SPSDataEngineSchemaReader.ClassGetIDFromName(constFragmentNameCustomTagBase);
LogEntry($"Custom Tag class ID: {classID}", LogLevels.Debug); LogEntry($"Custom Tag class ID: {classID}", LogLevels.Debug);
tblCustomTags = FragmentRequestBase.SimpleLoad(classID, "Key, Name", $"[Expression-ObjectID]='{objectId}'") ?? new DataTable(); tblCustomTags = FragmentRequestBase.SimpleLoad(classID, "Key, Name", $"[Expression-ObjectID]='{objectId}'") ?? new DataTable();
classID = SPSDataEngineSchemaReader.ClassGetIDFromName(constFragmentNameConfigNamingConvention); classID = SPSDataEngineSchemaReader.ClassGetIDFromName(constFragmentNameConfigNamingConvention);
LogEntry($"Naming convention config class ID: {classID}", LogLevels.Debug); LogEntry($"Naming convention config class ID: {classID}", LogLevels.Debug);
tblNamingConvention = FragmentRequestBase.SimpleLoad(classID, tblNamingConvention = FragmentRequestBase.SimpleLoad(classID,
"ID, Usage, NamingConvention.Description as Description, NamingConvention.DescriptionTemplate as DescriptionTemplate, " + "ID, Usage, NamingConvention.Description as Description, NamingConvention.DescriptionTemplate as DescriptionTemplate, " +
"NamingConvention.Name as Name, NamingConvention.NamingTemplate as NamingTemplate, NamingConvention.Wildcard as Wildcard", "NamingConvention.Name as Name, NamingConvention.NamingTemplate as NamingTemplate, NamingConvention.Wildcard as Wildcard",
$"[Expression-ObjectID]='{objectId}'") ?? new DataTable(); $"[Expression-ObjectID]='{objectId}'") ?? new DataTable();
return true; return true;
} }
catch (Exception e) catch (Exception e)
{ {
LogException(e); LogException(e);
return false; return false;
} }
} }
private cLiamProviderData buildProviderData(DataTable dtMain, DataTable dtBase, DataTable dtAdditional, DataTable dtNamingConvention, DataTable dtCustomTag, bool includeSecret, out string sanitizedJson) private cLiamProviderData buildProviderData(DataTable dtMain, DataTable dtBase, DataTable dtAdditional, DataTable dtNamingConvention, DataTable dtCustomTag, bool includeSecret, out string sanitizedJson)
{ {
sanitizedJson = null; sanitizedJson = null;
if (dtMain?.Rows == null || dtMain.Rows.Count <= 0) if (dtMain?.Rows == null || dtMain.Rows.Count <= 0)
return null; return null;
if (dtBase?.Rows == null || dtBase.Rows.Count <= 0) if (dtBase?.Rows == null || dtBase.Rows.Count <= 0)
return null; return null;
if (dtAdditional == null) if (dtAdditional == null)
return null; return null;
var dataMain = dtMain.Rows[0]; var dataMain = dtMain.Rows[0];
var dataBase = dtBase.Rows[0]; var dataBase = dtBase.Rows[0];
var encPW = cLIAMHelper.getStringFromObject(dataBase["Password"]); var encPW = cLIAMHelper.getStringFromObject(dataBase["Password"]);
if (!CryptoManager.Instance.TryDecryptDBText(encPW, out string password)) if (!CryptoManager.Instance.TryDecryptDBText(encPW, out string password))
password = encPW; password = encPW;
var providerData = new cLiamProviderData() var providerData = new cLiamProviderData()
{ {
Domain = cLIAMHelper.getStringFromObject(dataMain["GCCDomain"]), Domain = cLIAMHelper.getStringFromObject(dataMain["GCCDomain"]),
Credential = new cLiamCredential() Credential = new cLiamCredential()
{ {
Domain = cLIAMHelper.getStringFromObject(dataMain["GCCDomain"]), Domain = cLIAMHelper.getStringFromObject(dataMain["GCCDomain"]),
Identification = cLIAMHelper.getStringFromObject(dataBase["Account"]), Identification = cLIAMHelper.getStringFromObject(dataBase["Account"]),
Secret = "***" Secret = "***"
}, },
RootPath = cLIAMHelper.getStringFromObject(dataMain["GCCTarget"]), RootPath = cLIAMHelper.getStringFromObject(dataMain["GCCTarget"]),
MaxDepth = cLIAMHelper.getIntFromObject(dataMain["GCCMaxDepth"]), MaxDepth = cLIAMHelper.getIntFromObject(dataMain["GCCMaxDepth"]),
GroupFilter = cLIAMHelper.getStringFromObject(dataMain["GCCgroupLDAPFilter"]), GroupFilter = cLIAMHelper.getStringFromObject(dataMain["GCCgroupLDAPFilter"]),
GroupPath = cLIAMHelper.getStringFromObject(dataMain["GCCgroupOUPath"]), GroupPath = cLIAMHelper.getStringFromObject(dataMain["GCCgroupOUPath"]),
GroupStrategy = (eLiamGroupStrategies)cLIAMHelper.getIntFromObject(dataMain["GCCPermissionGroupStrategy"]), GroupStrategy = (eLiamGroupStrategies)cLIAMHelper.getIntFromObject(dataMain["GCCPermissionGroupStrategy"]),
ProviderType = (eLiamProviderTypes)cLIAMHelper.getIntFromObject(dataMain["GCCtargetType"]) ProviderType = (eLiamProviderTypes)cLIAMHelper.getIntFromObject(dataMain["GCCtargetType"])
}; };
if (dtAdditional?.Rows != null) if (dtAdditional?.Rows != null)
{ {
foreach (DataRow row in dtAdditional.Rows) foreach (DataRow row in dtAdditional.Rows)
{ {
var name = cLIAMHelper.getStringFromObject(row["Name"]); var name = cLIAMHelper.getStringFromObject(row["Name"]);
var value = cLIAMHelper.getStringFromObject(row["Value"]); var value = cLIAMHelper.getStringFromObject(row["Value"]);
if (!string.IsNullOrEmpty(name)) if (!string.IsNullOrEmpty(name))
providerData.AdditionalConfiguration[name] = value; providerData.AdditionalConfiguration[name] = value;
} }
} }
if (dtCustomTag?.Rows != null) if (dtCustomTag?.Rows != null)
{ {
foreach (DataRow row in dtCustomTag.Rows) foreach (DataRow row in dtCustomTag.Rows)
{ {
var name = cLIAMHelper.getStringFromObject(row["Key"]); var name = cLIAMHelper.getStringFromObject(row["Key"]);
var value = cLIAMHelper.getStringFromObject(row["Name"]); var value = cLIAMHelper.getStringFromObject(row["Name"]);
if (!string.IsNullOrEmpty(name)) if (!string.IsNullOrEmpty(name))
providerData.CustomTags[name] = value; providerData.CustomTags[name] = value;
} }
} }
if (dtNamingConvention?.Rows != null) if (dtNamingConvention?.Rows != null)
{ {
foreach (DataRow row in dtNamingConvention.Rows) foreach (DataRow row in dtNamingConvention.Rows)
{ {
var usage = cLIAMHelper.getIntFromObject(row["Usage"]); var usage = cLIAMHelper.getIntFromObject(row["Usage"]);
var accessRole = eLiamAccessRoles.Read; var accessRole = eLiamAccessRoles.Read;
var scope = eLiamAccessRoleScopes.Unknown; var scope = eLiamAccessRoleScopes.Unknown;
switch (usage) switch (usage)
{ {
case -10: case -10:
accessRole = eLiamAccessRoles.Traverse; accessRole = eLiamAccessRoles.Traverse;
scope = eLiamAccessRoleScopes.Global; scope = eLiamAccessRoleScopes.Global;
break; break;
case 10: case 10:
accessRole = eLiamAccessRoles.Read; accessRole = eLiamAccessRoles.Read;
scope = eLiamAccessRoleScopes.Global; scope = eLiamAccessRoleScopes.Global;
break; break;
case 20: case 20:
accessRole = eLiamAccessRoles.Write; accessRole = eLiamAccessRoles.Write;
scope = eLiamAccessRoleScopes.Global; scope = eLiamAccessRoleScopes.Global;
break; break;
case 30: case 30:
accessRole = eLiamAccessRoles.Owner; accessRole = eLiamAccessRoles.Owner;
scope = eLiamAccessRoleScopes.Global; scope = eLiamAccessRoleScopes.Global;
break; break;
case 40: case 40:
accessRole = eLiamAccessRoles.Read; accessRole = eLiamAccessRoles.Read;
scope = eLiamAccessRoleScopes.DomainLocal; scope = eLiamAccessRoleScopes.DomainLocal;
break; break;
case 50: case 50:
accessRole = eLiamAccessRoles.Write; accessRole = eLiamAccessRoles.Write;
scope = eLiamAccessRoleScopes.DomainLocal; scope = eLiamAccessRoleScopes.DomainLocal;
break; break;
case 60: case 60:
accessRole = eLiamAccessRoles.Owner; accessRole = eLiamAccessRoles.Owner;
scope = eLiamAccessRoleScopes.DomainLocal; scope = eLiamAccessRoleScopes.DomainLocal;
break; break;
case 100: case 100:
accessRole = eLiamAccessRoles.ADOwner; accessRole = eLiamAccessRoles.ADOwner;
scope = eLiamAccessRoleScopes.Global; scope = eLiamAccessRoleScopes.Global;
break; break;
case 110: case 110:
accessRole = eLiamAccessRoles.ADMember; accessRole = eLiamAccessRoles.ADMember;
scope = eLiamAccessRoleScopes.Global; scope = eLiamAccessRoleScopes.Global;
break; break;
case 200: case 200:
accessRole = eLiamAccessRoles.ExchangeMLMember; accessRole = eLiamAccessRoles.ExchangeMLMember;
scope = eLiamAccessRoleScopes.Universal; scope = eLiamAccessRoleScopes.Universal;
break; break;
case 210: case 210:
accessRole = eLiamAccessRoles.ExchangeMLOwner; accessRole = eLiamAccessRoles.ExchangeMLOwner;
scope = eLiamAccessRoleScopes.Universal; scope = eLiamAccessRoleScopes.Universal;
break; break;
case 250: case 250:
accessRole = eLiamAccessRoles.ExchangeSMBFullAccess; accessRole = eLiamAccessRoles.ExchangeSMBFullAccess;
scope = eLiamAccessRoleScopes.Universal; scope = eLiamAccessRoleScopes.Universal;
break; break;
case 260: case 260:
accessRole = eLiamAccessRoles.ExchangeSMBSendAs; accessRole = eLiamAccessRoles.ExchangeSMBSendAs;
scope = eLiamAccessRoleScopes.Universal; scope = eLiamAccessRoleScopes.Universal;
break; break;
case 270: case 270:
accessRole = eLiamAccessRoles.ExchangeSMBOwner; accessRole = eLiamAccessRoles.ExchangeSMBOwner;
scope = eLiamAccessRoleScopes.Universal; scope = eLiamAccessRoleScopes.Universal;
break; break;
} }
providerData.NamingConventions.Add(new cLiamNamingConvention() providerData.NamingConventions.Add(new cLiamNamingConvention()
{ {
AccessRole = accessRole, AccessRole = accessRole,
Scope = scope, Scope = scope,
Description = cLIAMHelper.getStringFromObject(row["Description"]), Description = cLIAMHelper.getStringFromObject(row["Description"]),
DescriptionTemplate = cLIAMHelper.getStringFromObject(row["DescriptionTemplate"]), DescriptionTemplate = cLIAMHelper.getStringFromObject(row["DescriptionTemplate"]),
Name = cLIAMHelper.getStringFromObject(row["Name"]), Name = cLIAMHelper.getStringFromObject(row["Name"]),
NamingTemplate = cLIAMHelper.getStringFromObject(row["NamingTemplate"]), NamingTemplate = cLIAMHelper.getStringFromObject(row["NamingTemplate"]),
Wildcard = cLIAMHelper.getStringFromObject(row["Wildcard"]) Wildcard = cLIAMHelper.getStringFromObject(row["Wildcard"])
}); });
} }
} }
sanitizedJson = JsonConvert.SerializeObject(providerData, Newtonsoft.Json.Formatting.Indented); sanitizedJson = JsonConvert.SerializeObject(providerData, Newtonsoft.Json.Formatting.Indented);
if (includeSecret && providerData.Credential != null) if (includeSecret && providerData.Credential != null)
providerData.Credential.Secret = password; providerData.Credential.Secret = password;
return providerData; return providerData;
} }
private cLiamProviderBase createProvider(DataTable dtMain, DataTable dtBase, DataTable dtAdditional, DataTable dtNamingConvention = null, DataTable dtCustomTag = null) private cLiamProviderBase createProvider(DataTable dtMain, DataTable dtBase, DataTable dtAdditional, DataTable dtNamingConvention = null, DataTable dtCustomTag = null)
{ {
var CM = MethodBase.GetCurrentMethod(); var CM = MethodBase.GetCurrentMethod();
LogMethodBegin(CM); LogMethodBegin(CM);
try try
{ {
var DataProviderData = buildProviderData(dtMain, dtBase, dtAdditional, dtNamingConvention, dtCustomTag, includeSecret: true, out var sanitizedJson); var DataProviderData = buildProviderData(dtMain, dtBase, dtAdditional, dtNamingConvention, dtCustomTag, includeSecret: true, out var sanitizedJson);
if (DataProviderData == null) if (DataProviderData == null)
return null; return null;
LogEntry("Provider configuration (sanitized JSON, copy for diagnostics tool):", LogLevels.Info); LogEntry("Provider configuration (sanitized JSON, copy for diagnostics tool):", LogLevels.Info);
LogEntry(sanitizedJson, LogLevels.Info); LogEntry(sanitizedJson, LogLevels.Info);
var DataProvider = CreateProviderInstance(new cLiamConfiguration(), DataProviderData); var DataProvider = CreateProviderInstance(new cLiamConfiguration(), DataProviderData);
return DataProvider; return DataProvider;
} }
@@ -804,11 +804,11 @@ where ";
} }
[Route("initializeDataProvider"), HttpGet] [Route("initializeDataProvider"), HttpGet]
public async Task<bool> initializeDataProvider(Guid ProviderConfigClassID, bool force = false) public async Task<bool> initializeDataProvider(Guid ProviderConfigClassID, bool force = false)
{ {
var CM = MethodBase.GetCurrentMethod(); var CM = MethodBase.GetCurrentMethod();
LogMethodBegin(CM); LogMethodBegin(CM);
try try
{ {
if (cC4ITLicenseM42ESM.Instance == null) if (cC4ITLicenseM42ESM.Instance == null)
LoadLicensingInformation(); LoadLicensingInformation();
@@ -829,61 +829,61 @@ where ";
finally finally
{ {
LogMethodEnd(CM); LogMethodEnd(CM);
} }
} }
[Route("exportProviderConfiguration"), HttpGet] [Route("exportProviderConfiguration"), HttpGet]
public IHttpActionResult exportProviderConfiguration(Guid ProviderConfigClassID) public IHttpActionResult exportProviderConfiguration(Guid ProviderConfigClassID)
{ {
var CM = MethodBase.GetCurrentMethod(); var CM = MethodBase.GetCurrentMethod();
LogMethodBegin(CM); LogMethodBegin(CM);
try try
{ {
if (cC4ITLicenseM42ESM.Instance == null) if (cC4ITLicenseM42ESM.Instance == null)
LoadLicensingInformation(); LoadLicensingInformation();
if (!cC4ITLicenseM42ESM.Instance.IsValid) if (!cC4ITLicenseM42ESM.Instance.IsValid)
{ {
LogEntry($"Error: License not valid", LogLevels.Error); LogEntry($"Error: License not valid", LogLevels.Error);
return Content(HttpStatusCode.Forbidden, "License not valid"); return Content(HttpStatusCode.Forbidden, "License not valid");
} }
if (!TryLoadProviderFragments(ProviderConfigClassID, out var objectId, out var tblMain, out var tblBase, out var tblAdditionalAttr, out var tblNamingConvention, out var tblCustomTags)) if (!TryLoadProviderFragments(ProviderConfigClassID, out var objectId, out var tblMain, out var tblBase, out var tblAdditionalAttr, out var tblNamingConvention, out var tblCustomTags))
{ {
return Content(HttpStatusCode.NotFound, $"Provider configuration '{ProviderConfigClassID}' not found."); return Content(HttpStatusCode.NotFound, $"Provider configuration '{ProviderConfigClassID}' not found.");
} }
var providerData = buildProviderData(tblMain, tblBase, tblAdditionalAttr, tblNamingConvention, tblCustomTags, includeSecret: false, out var sanitizedJson); var providerData = buildProviderData(tblMain, tblBase, tblAdditionalAttr, tblNamingConvention, tblCustomTags, includeSecret: false, out var sanitizedJson);
if (providerData == null) if (providerData == null)
return Content(HttpStatusCode.InternalServerError, "Provider configuration could not be loaded."); return Content(HttpStatusCode.InternalServerError, "Provider configuration could not be loaded.");
var export = new ProviderConfigurationExport var export = new ProviderConfigurationExport
{ {
ProviderConfigClassID = ProviderConfigClassID, ProviderConfigClassID = ProviderConfigClassID,
ProviderConfigObjectID = objectId, ProviderConfigObjectID = objectId,
SanitizedJson = sanitizedJson, SanitizedJson = sanitizedJson,
Configuration = providerData, Configuration = providerData,
GeneratedAtUtc = DateTime.UtcNow GeneratedAtUtc = DateTime.UtcNow
}; };
return Ok(export); return Ok(export);
} }
catch (Exception E) catch (Exception E)
{ {
LogException(E); LogException(E);
return InternalServerError(E); return InternalServerError(E);
} }
finally finally
{ {
LogMethodEnd(CM); LogMethodEnd(CM);
} }
} }
private async Task<ProviderCacheEntry> getDataProvider(Guid ProviderConfigClassID, bool force = false) private async Task<ProviderCacheEntry> getDataProvider(Guid ProviderConfigClassID, bool force = false)
{ {
var CM = MethodBase.GetCurrentMethod(); var CM = MethodBase.GetCurrentMethod();
LogMethodBegin(CM); LogMethodBegin(CM);
try try
{ {
if (!force) if (!force)
{ {
@@ -894,17 +894,17 @@ where ";
return Provider; return Provider;
} }
} }
if (!TryLoadProviderFragments(ProviderConfigClassID, out var ObjectID, out var tblMain, out var tblBase, out var tblAdditionalAttr, out var tblNamingConvention, out var tblCustomTags)) if (!TryLoadProviderFragments(ProviderConfigClassID, out var ObjectID, out var tblMain, out var tblBase, out var tblAdditionalAttr, out var tblNamingConvention, out var tblCustomTags))
return null; return null;
var DataProvider = createProvider(tblMain, tblBase, tblAdditionalAttr, tblNamingConvention, tblCustomTags); var DataProvider = createProvider(tblMain, tblBase, tblAdditionalAttr, tblNamingConvention, tblCustomTags);
if (DataProvider == null) if (DataProvider == null)
{ {
LogEntry($"Provider configuration '{ProviderConfigClassID}' could not be materialized.", LogLevels.Warning); LogEntry($"Provider configuration '{ProviderConfigClassID}' could not be materialized.", LogLevels.Warning);
return null; return null;
} }
var validLogon = await DataProvider.LogonAsync(); var validLogon = await DataProvider.LogonAsync();
if (!validLogon) if (!validLogon)
return null; return null;
@@ -1178,6 +1178,7 @@ where ";
Level = DataArea.Level.ToString(), Level = DataArea.Level.ToString(),
ConfigurationId = ProviderEntry.ObjectID.ToString(), ConfigurationId = ProviderEntry.ObjectID.ToString(),
DataAreaType = DataArea.DataType.ToString(), DataAreaType = DataArea.DataType.ToString(),
DataAreaTypeId = (int)DataArea.DataType,
Owner = owner, Owner = owner,
Write = write, Write = write,
Read = DataAreaNtfsFolder?.ReadGroupIdentifier ?? string.Empty, Read = DataAreaNtfsFolder?.ReadGroupIdentifier ?? string.Empty,
@@ -1857,34 +1858,34 @@ where ";
return accountEoid; return accountEoid;
} }
private string GetUserPrincipalNameFromEOID(Guid accountEoid) private string GetUserPrincipalNameFromEOID(Guid accountEoid)
{ {
var ClassID = SPSDataEngineSchemaReader.ClassGetIDFromName(constFragmentNameAccountAd); var ClassID = SPSDataEngineSchemaReader.ClassGetIDFromName(constFragmentNameAccountAd);
LogEntry($"Data area class ID: {ClassID}", LogLevels.Debug); LogEntry($"Data area class ID: {ClassID}", LogLevels.Debug);
var tbl = FragmentRequestBase.SimpleLoad(ClassID, "UserPrincipalName", $"[Expression-ObjectId]='{accountEoid}'"); var tbl = FragmentRequestBase.SimpleLoad(ClassID, "UserPrincipalName", $"[Expression-ObjectId]='{accountEoid}'");
if (tbl?.Rows == null || tbl.Rows.Count == 0) if (tbl?.Rows == null || tbl.Rows.Count == 0)
{ {
LogEntry($"No AD account entry list found with eoid='{accountEoid}'", LogLevels.Warning); LogEntry($"No AD account entry list found with eoid='{accountEoid}'", LogLevels.Warning);
return null; return null;
} }
var UPN = cLIAMHelper.getStringFromObject(tbl.Rows[0]["UserPrincipalName"]); var UPN = cLIAMHelper.getStringFromObject(tbl.Rows[0]["UserPrincipalName"]);
if (string.IsNullOrEmpty(UPN)) if (string.IsNullOrEmpty(UPN))
{ {
LogEntry("No UserPrincipalName found for AccountAd entry", LogLevels.Warning); LogEntry("No UserPrincipalName found for AccountAd entry", LogLevels.Warning);
return null; return null;
} }
return UPN; return UPN;
} }
public class ProviderConfigurationExport public class ProviderConfigurationExport
{ {
public Guid ProviderConfigClassID { get; set; } public Guid ProviderConfigClassID { get; set; }
public Guid ProviderConfigObjectID { get; set; } public Guid ProviderConfigObjectID { get; set; }
public string SanitizedJson { get; set; } public string SanitizedJson { get; set; }
public cLiamProviderData Configuration { get; set; } public cLiamProviderData Configuration { get; set; }
public DateTime GeneratedAtUtc { get; set; } public DateTime GeneratedAtUtc { get; set; }
} }
} }
} }

View File

@@ -669,7 +669,8 @@ namespace LiamWorkflowActivities
ConfigurationId = configurationId ?? string.Empty, ConfigurationId = configurationId ?? string.Empty,
BaseFolder = ntfsFolder?.Share?.TechnicalName ?? dataArea.Provider?.RootPath ?? string.Empty, BaseFolder = ntfsFolder?.Share?.TechnicalName ?? dataArea.Provider?.RootPath ?? string.Empty,
UniqueId = dataArea.UID ?? string.Empty, UniqueId = dataArea.UID ?? string.Empty,
DataAreaType = dataArea.DataType.ToString() DataAreaType = dataArea.DataType.ToString(),
DataAreaTypeId = (int)dataArea.DataType
}; };
} }