CRUD - Assets create

This commit is contained in:
anomny
2025-10-04 14:37:10 +02:00
parent a34534eb62
commit ef3be7cb41
3 changed files with 71 additions and 4 deletions

View File

@@ -175,10 +175,16 @@ public partial class LdapService : IDisposable
await CreateObject(dn, attributeSet);
}
public async Task CreateAsset(LdapAttributeSet attributeSet)
{
await CreateObject(AssetsBaseDn, attributeSet);
}
public async Task CreateAsset(LdapAttributeSet attributeSet)
{
string? cn = attributeSet.GetAttribute("cn")?.StringValue;
if (string.IsNullOrEmpty(cn))
throw new ArgumentException("AttributeSet must contain a cn attribute.");
string dn = PrependRDN($"cn={cn}", AssetsBaseDn);
await CreateObject(dn, attributeSet);
}
public async Task CreateLocation(LdapAttributeSet attributeSet)
{