Permissions & Authorization for Users #24

Initial Release; Includes Database and MVC refactoring
This commit is contained in:
Gary Sharp
2013-10-10 19:13:16 +11:00
parent 172ce5524a
commit a099d68915
458 changed files with 40221 additions and 12130 deletions
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Models.Interop.ActiveDirectory
{
public class ActiveDirectoryGroup : IActiveDirectoryObject
{
public string Name { get; set; }
public string DistinguishedName { get; set; }
public string SamAccountName { get; set; }
public string SecurityIdentifier { get; set; }
public string CommonName { get; set; }
public List<string> MemberOf { get; set; }
}
}
@@ -6,37 +6,24 @@ using Disco.Models.Repository;
namespace Disco.Models.Interop.ActiveDirectory
{
public class ActiveDirectoryMachineAccount
public class ActiveDirectoryMachineAccount : IActiveDirectoryObject
{
public string DistinguishedName { get; set; }
public string DnsName { get; set; }
public string Domain { get; set; }
public string Name { get; set; }
public Guid NetbootGUID { get; set; }
public string ObjectSid { get; set; }
public string SecurityIdentifier { get; set; }
public string Path { get; set; }
public string sAMAccountName { get; set; }
public string SamAccountName { get; set; }
public bool IsCriticalSystemObject { get; set; }
public Dictionary<string, object[]> LoadedProperties { get; set; }
public string ParentDistinguishedName
{
get
{
// Determine Parent
if (!string.IsNullOrWhiteSpace(DistinguishedName))
return DistinguishedName.Substring(0, DistinguishedName.IndexOf(",DC=")).Substring(DistinguishedName.IndexOf(",") + 1);
else
return null;
}
}
public User ToRepositoryUser()
{
return new User
{
Id = this.sAMAccountName,
Type = "Computer",
Id = this.SamAccountName,
DisplayName = this.Name
};
}
@@ -6,7 +6,7 @@ using Disco.Models.Repository;
namespace Disco.Models.Interop.ActiveDirectory
{
public class ActiveDirectoryUserAccount
public class ActiveDirectoryUserAccount : IActiveDirectoryObject
{
public string DisplayName { get; set; }
public string DistinguishedName { get; set; }
@@ -15,25 +15,23 @@ namespace Disco.Models.Interop.ActiveDirectory
public string GivenName { get; set; }
public List<string> Groups { get; set; }
public string Name { get; set; }
public string ObjectSid { get; set; }
public string SecurityIdentifier { get; set; }
public string Path { get; set; }
public string Phone { get; set; }
public string sAMAccountName { get; set; }
public string SamAccountName { get; set; }
public string Surname { get; set; }
public string Type { get; set; }
public Dictionary<string, object[]> LoadedProperties { get; set; }
public User ToRepositoryUser()
{
return new User
{
Id = this.sAMAccountName,
Id = this.SamAccountName,
DisplayName = this.DisplayName,
Surname = this.Surname,
GivenName = this.GivenName,
EmailAddress = this.Email,
PhoneNumber = this.Phone,
Type = this.Type
};
}
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Models.Interop.ActiveDirectory
{
public interface IActiveDirectoryObject
{
string DistinguishedName { get; set; }
string SecurityIdentifier { get; set; }
string SamAccountName { get; set; }
string Name { get; set; }
}
}