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,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Services.Authorization.Roles.ClaimGroups.Job
{
[ClaimDetails("Actions", "Permissions related to Job Actions")]
public class JobActionsClaims : BaseRoleClaimGroup
{
[ClaimDetails("Create Jobs", "Can create jobs")]
public bool Create { get; set; }
[ClaimDetails("Close Jobs", "Can close jobs")]
public bool Close { get; set; }
[ClaimDetails("Force Close Jobs", "Can force close jobs")]
public bool ForceClose { get; set; }
[ClaimDetails("Reopen Jobs", "Can reopen jobs")]
public bool Reopen { get; set; }
[ClaimDetails("Delete Jobs", "Can delete jobs")]
public bool Delete { get; set; }
[ClaimDetails("Log Warranty", "Can log warranty for jobs")]
public bool LogWarranty { get; set; }
[ClaimDetails("Log Repair", "Can log repair for non-warranty jobs")]
public bool LogRepair { get; set; }
[ClaimDetails("Convert HWar Jobs To HNWar", "Can convert warranty jobs to non-warranty jobs")]
public bool ConvertHWarToHNWar { get; set; }
[ClaimDetails("Add Logs", "Can add job logs")]
public bool AddLogs { get; set; }
[ClaimDetails("Remove Any Logs", "Can remove any job logs")]
public bool RemoveAnyLogs { get; set; }
[ClaimDetails("Remove Own Logs", "Can remove own job logs")]
public bool RemoveOwnLogs { get; set; }
[ClaimDetails("Add Attachments", "Can add attachments to jobs")]
public bool AddAttachments { get; set; }
[ClaimDetails("Remove Any Attachments", "Can remove any attachments from jobs")]
public bool RemoveAnyAttachments { get; set; }
[ClaimDetails("Remove Own Attachments", "Can remove own attachments from jobs")]
public bool RemoveOwnAttachments { get; set; }
[ClaimDetails("Generate Documents", "Can generate documents for jobs")]
public bool GenerateDocuments { get; set; }
[ClaimDetails("Update Sub Types", "Can update sub types for jobs")]
public bool UpdateSubTypes { get; set; }
}
}
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Services.Authorization.Roles.ClaimGroups.Job
{
[ClaimDetails("Job", "Permissions related to Jobs")]
public class JobClaims : BaseRoleClaimGroup
{
public JobClaims()
{
this.Lists = new JobListsClaims();
this.Actions = new JobActionsClaims();
this.Properties = new JobPropertiesClaims();
this.Types = new JobTypesClaims();
}
[ClaimDetails("Search Jobs", "Can search jobs")]
public bool Search { get; set; }
[ClaimDetails("Show Jobs", "Can show jobs")]
public bool Show { get; set; }
[ClaimDetails("Show Daily Opened & Closed", "Can show daily opened & closed chart")]
public bool ShowDailyChart { get; set; }
[ClaimDetails("Show Logs", "Can show job logs")]
public bool ShowLogs { get; set; }
[ClaimDetails("Show Attachments", "Can show job attachments")]
public bool ShowAttachments { get; set; }
[ClaimDetails("Show Non-Warranty Components", "Can show non-warranty job components")]
public bool ShowNonWarrantyComponents { get; set; }
[ClaimDetails("Show Non-Warranty Finance", "Can show non-warranty job finance")]
public bool ShowNonWarrantyFinance { get; set; }
[ClaimDetails("Show Non-Warranty Repairs", "Can show non-warranty job repairs")]
public bool ShowNonWarrantyRepairs { get; set; }
[ClaimDetails("Show Non-Warranty Insurance", "Can show non-warranty job insurance")]
public bool ShowNonWarrantyInsurance { get; set; }
[ClaimDetails("Show Warranty", "Can show job warranty")]
public bool ShowWarranty { get; set; }
[ClaimDetails("Show Flags", "Can show job flags")]
public bool ShowFlags { get; set; }
public JobListsClaims Lists { get; set; }
public JobActionsClaims Actions { get; set; }
public JobPropertiesClaims Properties { get; set; }
public JobTypesClaims Types { get; set; }
}
}
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Services.Authorization.Roles.ClaimGroups.Job
{
[ClaimDetails("Lists", "Permissions related to Job Lists")]
public class JobListsClaims : BaseRoleClaimGroup
{
[ClaimDetails("Awaiting Technician Action List", "Can show list")]
public bool AwaitingTechnicianAction { get; set; }
[ClaimDetails("Long Running Jobs List", "Can show list")]
public bool LongRunningJobs { get; set; }
[ClaimDetails("All Open List", "Can show list")]
public bool AllOpen { get; set; }
[ClaimDetails("Devices Ready For Return List", "Can show list")]
public bool DevicesReadyForReturn { get; set; }
[ClaimDetails("Devices Awaiting Repair List", "Can show list")]
public bool DevicesAwaitingRepair { get; set; }
[ClaimDetails("Awaiting Finance List", "Can show list")]
public bool AwaitingFinance { get; set; }
[ClaimDetails("Awaiting Finance Charge List", "Can show list (NOTE: Requires Awaiting Finance List)")]
public bool AwaitingFinanceCharge { get; set; }
[ClaimDetails("Awaiting Finance Payment List", "Can show list (NOTE: Requires Awaiting Finance List)")]
public bool AwaitingFinancePayment { get; set; }
[ClaimDetails("Awaiting Finance Insurance Processing List", "Can show list (NOTE: Requires Awaiting Finance List)")]
public bool AwaitingFinanceInsuranceProcessing { get; set; }
[ClaimDetails("Awaiting Finance Agreement Breach List", "Can show list (NOTE: Requires Awaiting Finance List)")]
public bool AwaitingFinanceAgreementBreach { get; set; }
[ClaimDetails("Awaiting User Action List", "Can show list")]
public bool AwaitingUserAction { get; set; }
[ClaimDetails("Recently Closed List", "Can show list")]
public bool RecentlyClosed { get; set; }
[ClaimDetails("Locations List", "Can show list")]
public bool Locations { get; set; }
}
}
@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Services.Authorization.Roles.ClaimGroups.Job
{
[ClaimDetails("Non Warranty Properties", "Permissions related to Non-Warranty Job Properties")]
public class JobNonWarrantyPropertiesClaims : BaseRoleClaimGroup
{
[ClaimDetails("Add Components", "Can add job components (NOTE: Requires Edit Components)")]
public bool AddComponents { get; set; }
[ClaimDetails("Edit Components", "Can edit and remove job components")]
public bool EditComponents { get; set; }
[ClaimDetails("Is Insurance Claim Property", "Can update property")]
public bool IsInsuranceClaim { get; set; }
[ClaimDetails("Insurance Claim Form Sent Property", "Can update property")]
public bool InsuranceClaimFormSent { get; set; }
[ClaimDetails("Accounting Charge Required Property", "Can update property")]
public bool AccountingChargeRequired { get; set; }
[ClaimDetails("Accounting Charge Added Property", "Can update property")]
public bool AccountingChargeAdded { get; set; }
[ClaimDetails("Accounting Charge Paid Property", "Can update property")]
public bool AccountingChargePaid { get; set; }
[ClaimDetails("Purchase Order Raised Property", "Can update property")]
public bool PurchaseOrderRaised { get; set; }
[ClaimDetails("Purchase Order Reference Property", "Can update property")]
public bool PurchaseOrderReference { get; set; }
[ClaimDetails("Purchase Order Sent Property", "Can update property")]
public bool PurchaseOrderSent { get; set; }
[ClaimDetails("Invoice Received Property", "Can update property")]
public bool InvoiceReceived { get; set; }
[ClaimDetails("Repairer Name Property", "Can update property")]
public bool RepairerName { get; set; }
[ClaimDetails("Repairer Completed Date Property", "Can update property")]
public bool RepairerCompletedDate { get; set; }
[ClaimDetails("Repairer Logged Date Property", "Can update property")]
public bool RepairerLoggedDate { get; set; }
[ClaimDetails("Repairer Reference Property", "Can update property")]
public bool RepairerReference { get; set; }
[ClaimDetails("Insurance Detail Properties", "Can update insurance detail properties")]
public bool InsuranceDetails { get; set; }
}
}
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Services.Authorization.Roles.ClaimGroups.Job
{
[ClaimDetails("Job Properties", "Permissions related to Job Properties")]
public class JobPropertiesClaims : BaseRoleClaimGroup
{
public JobPropertiesClaims()
{
this.WarrantyProperties = new JobWarrantyPropertiesClaims();
this.NonWarrantyProperties = new JobNonWarrantyPropertiesClaims();
}
public JobWarrantyPropertiesClaims WarrantyProperties { get; set; }
public JobNonWarrantyPropertiesClaims NonWarrantyProperties { get; set; }
[ClaimDetails("Device Held Property", "Can update property")]
public bool DeviceHeld { get; set; }
[ClaimDetails("Device Ready For Return Property", "Can update property")]
public bool DeviceReadyForReturn { get; set; }
[ClaimDetails("Device Returned Property", "Can update property")]
public bool DeviceReturned { get; set; }
[ClaimDetails("Waiting For User Action Property", "Can update property")]
public bool WaitingForUserAction { get; set; }
[ClaimDetails("Not Waiting For User Action Property", "Can update property")]
public bool NotWaitingForUserAction { get; set; }
[ClaimDetails("Flags Property", "Can update property")]
public bool Flags { get; set; }
[ClaimDetails("Expected Closed Date Property", "Can update property")]
public bool ExpectedClosedDate { get; set; }
[ClaimDetails("Device Held Location Property", "Can update property")]
public bool DeviceHeldLocation { get; set; }
}
}
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Services.Authorization.Roles.ClaimGroups.Job
{
[ClaimDetails("Types", "Permissions related to Job Types")]
public class JobTypesClaims : BaseRoleClaimGroup
{
[ClaimDetails("Show Hardware - Miscellaneous Jobs", "Can show jobs of this type")]
public bool ShowHMisc { get; set; }
[ClaimDetails("Show Hardware - Non-Warranty Jobs", "Can show jobs of this type")]
public bool ShowHNWar { get; set; }
[ClaimDetails("Show Hardware - Warranty Jobs", "Can show jobs of this type")]
public bool ShowHWar { get; set; }
[ClaimDetails("Show Software - Application Jobs", "Can show jobs of this type")]
public bool ShowSApp { get; set; }
[ClaimDetails("Show Software - Reimage Jobs", "Can show jobs of this type")]
public bool ShowSImg { get; set; }
[ClaimDetails("Show Software - Operating System Jobs", "Can show jobs of this type")]
public bool ShowSOS { get; set; }
[ClaimDetails("Show User Management Jobs", "Can show jobs of this type")]
public bool ShowUMgmt { get; set; }
}
}
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Services.Authorization.Roles.ClaimGroups.Job
{
[ClaimDetails("Warranty Properties", "Permissions related to Warranty Job Properties")]
public class JobWarrantyPropertiesClaims : BaseRoleClaimGroup
{
[ClaimDetails("Warranty Completed Property", "Can update property")]
public bool WarrantyCompleted { get; set; }
[ClaimDetails("External Name Property", "Can update property")]
public bool ExternalName { get; set; }
[ClaimDetails("External Logged Date Property", "Can update property")]
public bool ExternalLoggedDate { get; set; }
[ClaimDetails("External Reference Property", "Can update property")]
public bool ExternalReference { get; set; }
[ClaimDetails("External Completed Date Property", "Can update property")]
public bool ExternalCompletedDate { get; set; }
[ClaimDetails("Provider Details", "Can access warranty provider details")]
public bool ProviderDetails { get; set; }
}
}