e984221c95
User Attachments updated in the DataStore to reflect new UserId (which includes the domain); AD Groups were using DnsName instead of NetBiosName.
25 lines
719 B
C#
25 lines
719 B
C#
using Disco.Models.Interop.ActiveDirectory;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
|
|
namespace Disco.Web.Areas.API.Models.AuthorizationRole
|
|
{
|
|
public class SubjectItem
|
|
{
|
|
public string Id { get; set; }
|
|
public string Name { get; set; }
|
|
public string Type { get; set; }
|
|
|
|
public static SubjectItem FromActiveDirectoryObject(IActiveDirectoryObject ADObject)
|
|
{
|
|
return new Models.AuthorizationRole.SubjectItem()
|
|
{
|
|
Id = ADObject.NetBiosId,
|
|
Name = ADObject.DisplayName,
|
|
Type = ADObject is ActiveDirectoryGroup ? "group" : "user"
|
|
};
|
|
}
|
|
}
|
|
} |