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
@@ -12,6 +12,7 @@ namespace Disco.Web.Areas.API.Models.Attachment
public string ParentId { get; set; }
public int Id { get; set; }
public string Author { get; set; }
public string AuthorId { get; set; }
public DateTime Timestamp { get; set; }
public string Comments { get; set; }
public string Filename { get; set; }
@@ -45,6 +46,7 @@ namespace Disco.Web.Areas.API.Models.Attachment
{
ParentId = ua.UserId,
Id = ua.Id,
AuthorId = ua.TechUserId,
Author = ua.TechUser.ToString(),
Timestamp = ua.Timestamp,
Comments = ua.Comments,
@@ -58,6 +60,7 @@ namespace Disco.Web.Areas.API.Models.Attachment
{
ParentId = ja.JobId.ToString(),
Id = ja.Id,
AuthorId = ja.TechUserId,
Author = ja.TechUser.ToString(),
Timestamp = ja.Timestamp,
Comments = ja.Comments,
@@ -71,6 +74,7 @@ namespace Disco.Web.Areas.API.Models.Attachment
{
ParentId = da.DeviceSerialNumber,
Id = da.Id,
AuthorId = da.TechUserId,
Author = da.TechUser.ToString(),
Timestamp = da.Timestamp,
Comments = da.Comments,
@@ -0,0 +1,25 @@
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.SamAccountName,
Name = ADObject.Name,
Type = ADObject is ActiveDirectoryGroup ? "group" : "user"
};
}
}
}
@@ -11,6 +11,7 @@ namespace Disco.Web.Areas.API.Models.Job
{
public int Id { get; set; }
public int JobId { get; set; }
public string AuthorId { get; set; }
public string Author { get; set; }
public DateTime Timestamp { get; set; }
public string Comments { get; set; }
@@ -43,6 +44,7 @@ namespace Disco.Web.Areas.API.Models.Job
{
Id = jl.Id,
JobId = jl.JobId,
AuthorId = jl.TechUserId,
Author = jl.TechUser.ToString(),
Timestamp = jl.Timestamp,
Comments = jl.Comments