// // This file was generated by a T4 template. // Don't change it directly as your change would get overwritten. Instead, make changes // to the .tt file (i.e. the T4 template) and save it to regenerate this file. using Disco.Models.Authorization; using Disco.Models.Repository; using Disco.Services.Authorization.Roles; using System; using System.Collections.Generic; using System.Linq; namespace Disco.Services.Authorization { public static class Claims { private static Dictionary, Action, string, string, bool>> _roleClaims; private static ClaimNavigatorItem _claimNavigator; static Claims() { #region Role Claim Dictionary _roleClaims = new Dictionary, Action, string, string, bool>>() { { "Config.DeviceCertificate.DownloadCertificates", new Tuple, Action, string, string, bool>(c => c.Config.DeviceCertificate.DownloadCertificates, (c, v) => c.Config.DeviceCertificate.DownloadCertificates = v, "Download Certificates", "Can download certificates", false) }, { "Config.Enrolment.Configure", new Tuple, Action, string, string, bool>(c => c.Config.Enrolment.Configure, (c, v) => c.Config.Enrolment.Configure = v, "Configure Enrolment", "Can configure device enrolment", false) }, { "Config.Enrolment.DownloadBootstrapper", new Tuple, Action, string, string, bool>(c => c.Config.Enrolment.DownloadBootstrapper, (c, v) => c.Config.Enrolment.DownloadBootstrapper = v, "Download Bootstrapper", "Can download the Device Bootstrapper", false) }, { "Config.Enrolment.Show", new Tuple, Action, string, string, bool>(c => c.Config.Enrolment.Show, (c, v) => c.Config.Enrolment.Show = v, "Show Enrolment", "Can show device enrolment", false) }, { "Config.Enrolment.ShowStatus", new Tuple, Action, string, string, bool>(c => c.Config.Enrolment.ShowStatus, (c, v) => c.Config.Enrolment.ShowStatus = v, "Show Enrolment Status", "Can show the enrolment status", false) }, { "Config.DeviceBatch.Configure", new Tuple, Action, string, string, bool>(c => c.Config.DeviceBatch.Configure, (c, v) => c.Config.DeviceBatch.Configure = v, "Configure Device Batches", "Can configure device batches", false) }, { "Config.DeviceBatch.Create", new Tuple, Action, string, string, bool>(c => c.Config.DeviceBatch.Create, (c, v) => c.Config.DeviceBatch.Create = v, "Create Device Batches", "Can create device batches", false) }, { "Config.DeviceBatch.Delete", new Tuple, Action, string, string, bool>(c => c.Config.DeviceBatch.Delete, (c, v) => c.Config.DeviceBatch.Delete = v, "Delete Device Batches", "Can delete device batches", false) }, { "Config.DeviceBatch.Show", new Tuple, Action, string, string, bool>(c => c.Config.DeviceBatch.Show, (c, v) => c.Config.DeviceBatch.Show = v, "Show Device Batches", "Can show device batches", false) }, { "Config.DeviceBatch.ShowTimeline", new Tuple, Action, string, string, bool>(c => c.Config.DeviceBatch.ShowTimeline, (c, v) => c.Config.DeviceBatch.ShowTimeline = v, "Show Timeline", "Can show device batch timeline", false) }, { "Config.DeviceModel.ConfigureComponents", new Tuple, Action, string, string, bool>(c => c.Config.DeviceModel.ConfigureComponents, (c, v) => c.Config.DeviceModel.ConfigureComponents = v, "Configure Device Model Components", "Can configure device model components", false) }, { "Config.DeviceModel.Configure", new Tuple, Action, string, string, bool>(c => c.Config.DeviceModel.Configure, (c, v) => c.Config.DeviceModel.Configure = v, "Configure Device Models", "Can configure device models", false) }, { "Config.DeviceModel.Delete", new Tuple, Action, string, string, bool>(c => c.Config.DeviceModel.Delete, (c, v) => c.Config.DeviceModel.Delete = v, "Delete Device Models", "Can delete device models", false) }, { "Config.DeviceModel.Show", new Tuple, Action, string, string, bool>(c => c.Config.DeviceModel.Show, (c, v) => c.Config.DeviceModel.Show = v, "Show Device Models", "Can show device models", false) }, { "Config.DeviceProfile.ConfigureComputerNameTemplate", new Tuple, Action, string, string, bool>(c => c.Config.DeviceProfile.ConfigureComputerNameTemplate, (c, v) => c.Config.DeviceProfile.ConfigureComputerNameTemplate = v, "Configure Computer Name Templates", "Can configure computer name templates for device profiles", false) }, { "Config.DeviceProfile.ConfigureDefaults", new Tuple, Action, string, string, bool>(c => c.Config.DeviceProfile.ConfigureDefaults, (c, v) => c.Config.DeviceProfile.ConfigureDefaults = v, "Configure Default Device Profiles", "Can configure default device profiles", false) }, { "Config.DeviceProfile.Configure", new Tuple, Action, string, string, bool>(c => c.Config.DeviceProfile.Configure, (c, v) => c.Config.DeviceProfile.Configure = v, "Configure Device Profiles", "Can configure device profiles", false) }, { "Config.DeviceProfile.Create", new Tuple, Action, string, string, bool>(c => c.Config.DeviceProfile.Create, (c, v) => c.Config.DeviceProfile.Create = v, "Create Device Profiles", "Can create device profiles", false) }, { "Config.DeviceProfile.Delete", new Tuple, Action, string, string, bool>(c => c.Config.DeviceProfile.Delete, (c, v) => c.Config.DeviceProfile.Delete = v, "Delete Device Profiles", "Can delete device profiles", false) }, { "Config.DeviceProfile.Show", new Tuple, Action, string, string, bool>(c => c.Config.DeviceProfile.Show, (c, v) => c.Config.DeviceProfile.Show = v, "Show Device Profiles", "Can show device profiles", false) }, { "Config.DocumentTemplate.BulkGenerate", new Tuple, Action, string, string, bool>(c => c.Config.DocumentTemplate.BulkGenerate, (c, v) => c.Config.DocumentTemplate.BulkGenerate = v, "Bulk Generate Document Templates", "Can bulk generate document templates", false) }, { "Config.DocumentTemplate.Configure", new Tuple, Action, string, string, bool>(c => c.Config.DocumentTemplate.Configure, (c, v) => c.Config.DocumentTemplate.Configure = v, "Configure Document Templates", "Can configure document templates", false) }, { "Config.DocumentTemplate.ConfigureFilterExpression", new Tuple, Action, string, string, bool>(c => c.Config.DocumentTemplate.ConfigureFilterExpression, (c, v) => c.Config.DocumentTemplate.ConfigureFilterExpression = v, "Configure Filter Expression", "Can configure filter expressions for document templates", false) }, { "Config.DocumentTemplate.Create", new Tuple, Action, string, string, bool>(c => c.Config.DocumentTemplate.Create, (c, v) => c.Config.DocumentTemplate.Create = v, "Create Document Templates", "Can create document templates", false) }, { "Config.DocumentTemplate.Delete", new Tuple, Action, string, string, bool>(c => c.Config.DocumentTemplate.Delete, (c, v) => c.Config.DocumentTemplate.Delete = v, "Delete Document Templates", "Can delete document templates", false) }, { "Config.DocumentTemplate.ShowStatus", new Tuple, Action, string, string, bool>(c => c.Config.DocumentTemplate.ShowStatus, (c, v) => c.Config.DocumentTemplate.ShowStatus = v, "Show Document Template Import Status", "Can show the document template import status", false) }, { "Config.DocumentTemplate.Show", new Tuple, Action, string, string, bool>(c => c.Config.DocumentTemplate.Show, (c, v) => c.Config.DocumentTemplate.Show = v, "Show Document Templates", "Can show document templates", false) }, { "Config.DocumentTemplate.UndetectedPages", new Tuple, Action, string, string, bool>(c => c.Config.DocumentTemplate.UndetectedPages, (c, v) => c.Config.DocumentTemplate.UndetectedPages = v, "Undetected Pages", "Can show and assign imported documents which were not undetected", false) }, { "Config.DocumentTemplate.Upload", new Tuple, Action, string, string, bool>(c => c.Config.DocumentTemplate.Upload, (c, v) => c.Config.DocumentTemplate.Upload = v, "Upload Document Templates", "Can upload document templates", false) }, { "Config.Logging.Show", new Tuple, Action, string, string, bool>(c => c.Config.Logging.Show, (c, v) => c.Config.Logging.Show = v, "Show Logging", "Can show logging", false) }, { "Config.Plugin.Configure", new Tuple, Action, string, string, bool>(c => c.Config.Plugin.Configure, (c, v) => c.Config.Plugin.Configure = v, "Configure Plugins", "Can configure plugins", false) }, { "Config.Plugin.InstallLocal", new Tuple, Action, string, string, bool>(c => c.Config.Plugin.InstallLocal, (c, v) => c.Config.Plugin.InstallLocal = v, "Install/Update Local Plugins", "Can install and update locally uploaded plugins", false) }, { "Config.Plugin.Install", new Tuple, Action, string, string, bool>(c => c.Config.Plugin.Install, (c, v) => c.Config.Plugin.Install = v, "Install/Update Plugins", "Can install and update plugins", false) }, { "Config.Plugin.Show", new Tuple, Action, string, string, bool>(c => c.Config.Plugin.Show, (c, v) => c.Config.Plugin.Show = v, "Show Plugins", "Can show plugins", false) }, { "Config.Plugin.Uninstall", new Tuple, Action, string, string, bool>(c => c.Config.Plugin.Uninstall, (c, v) => c.Config.Plugin.Uninstall = v, "Uninstall Plugins", "Can uninstall plugins", false) }, { "Config.System.ConfigureProxy", new Tuple, Action, string, string, bool>(c => c.Config.System.ConfigureProxy, (c, v) => c.Config.System.ConfigureProxy = v, "Configure Proxy Settings", "Can configure the proxy settings", false) }, { "Config.System.Show", new Tuple, Action, string, string, bool>(c => c.Config.System.Show, (c, v) => c.Config.System.Show = v, "Show System Configuration", "Can show the system configuration", false) }, { "Config.Organisation.ConfigureAddresses", new Tuple, Action, string, string, bool>(c => c.Config.Organisation.ConfigureAddresses, (c, v) => c.Config.Organisation.ConfigureAddresses = v, "Configure Addresses", "Can configure organisation addresses", false) }, { "Config.Organisation.ConfigureLogo", new Tuple, Action, string, string, bool>(c => c.Config.Organisation.ConfigureLogo, (c, v) => c.Config.Organisation.ConfigureLogo = v, "Configure Logo", "Can configure the organisation logo", false) }, { "Config.Organisation.ConfigureMultiSiteMode", new Tuple, Action, string, string, bool>(c => c.Config.Organisation.ConfigureMultiSiteMode, (c, v) => c.Config.Organisation.ConfigureMultiSiteMode = v, "Configure Multi-Site Mode", "Can configure multi-site mode", false) }, { "Config.Organisation.ConfigureName", new Tuple, Action, string, string, bool>(c => c.Config.Organisation.ConfigureName, (c, v) => c.Config.Organisation.ConfigureName = v, "Configure Name", "Can configure the organisation name", false) }, { "Config.Organisation.Show", new Tuple, Action, string, string, bool>(c => c.Config.Organisation.Show, (c, v) => c.Config.Organisation.Show = v, "Show Organisation Details", "Can show the organisation details", false) }, { "Config.JobPreferences.Configure", new Tuple, Action, string, string, bool>(c => c.Config.JobPreferences.Configure, (c, v) => c.Config.JobPreferences.Configure = v, "Configure Job Preferences", "Can configure job preferences", false) }, { "Config.JobPreferences.Show", new Tuple, Action, string, string, bool>(c => c.Config.JobPreferences.Show, (c, v) => c.Config.JobPreferences.Show = v, "Show Job Preferences", "Can show job preferences", false) }, { "Config.Show", new Tuple, Action, string, string, bool>(c => c.Config.Show, (c, v) => c.Config.Show = v, "Show Configuration", "Can show the configuration menu", false) }, { "Job.Lists.AllOpen", new Tuple, Action, string, string, bool>(c => c.Job.Lists.AllOpen, (c, v) => c.Job.Lists.AllOpen = v, "All Open List", "Can show list", false) }, { "Job.Lists.AwaitingFinanceAgreementBreach", new Tuple, Action, string, string, bool>(c => c.Job.Lists.AwaitingFinanceAgreementBreach, (c, v) => c.Job.Lists.AwaitingFinanceAgreementBreach = v, "Awaiting Finance Agreement Breach List", "Can show list (NOTE: Requires Awaiting Finance List)", false) }, { "Job.Lists.AwaitingFinanceCharge", new Tuple, Action, string, string, bool>(c => c.Job.Lists.AwaitingFinanceCharge, (c, v) => c.Job.Lists.AwaitingFinanceCharge = v, "Awaiting Finance Charge List", "Can show list (NOTE: Requires Awaiting Finance List)", false) }, { "Job.Lists.AwaitingFinanceInsuranceProcessing", new Tuple, Action, string, string, bool>(c => c.Job.Lists.AwaitingFinanceInsuranceProcessing, (c, v) => c.Job.Lists.AwaitingFinanceInsuranceProcessing = v, "Awaiting Finance Insurance Processing List", "Can show list (NOTE: Requires Awaiting Finance List)", false) }, { "Job.Lists.AwaitingFinance", new Tuple, Action, string, string, bool>(c => c.Job.Lists.AwaitingFinance, (c, v) => c.Job.Lists.AwaitingFinance = v, "Awaiting Finance List", "Can show list", false) }, { "Job.Lists.AwaitingFinancePayment", new Tuple, Action, string, string, bool>(c => c.Job.Lists.AwaitingFinancePayment, (c, v) => c.Job.Lists.AwaitingFinancePayment = v, "Awaiting Finance Payment List", "Can show list (NOTE: Requires Awaiting Finance List)", false) }, { "Job.Lists.AwaitingTechnicianAction", new Tuple, Action, string, string, bool>(c => c.Job.Lists.AwaitingTechnicianAction, (c, v) => c.Job.Lists.AwaitingTechnicianAction = v, "Awaiting Technician Action List", "Can show list", false) }, { "Job.Lists.AwaitingUserAction", new Tuple, Action, string, string, bool>(c => c.Job.Lists.AwaitingUserAction, (c, v) => c.Job.Lists.AwaitingUserAction = v, "Awaiting User Action List", "Can show list", false) }, { "Job.Lists.DevicesAwaitingRepair", new Tuple, Action, string, string, bool>(c => c.Job.Lists.DevicesAwaitingRepair, (c, v) => c.Job.Lists.DevicesAwaitingRepair = v, "Devices Awaiting Repair List", "Can show list", false) }, { "Job.Lists.DevicesReadyForReturn", new Tuple, Action, string, string, bool>(c => c.Job.Lists.DevicesReadyForReturn, (c, v) => c.Job.Lists.DevicesReadyForReturn = v, "Devices Ready For Return List", "Can show list", false) }, { "Job.Lists.Locations", new Tuple, Action, string, string, bool>(c => c.Job.Lists.Locations, (c, v) => c.Job.Lists.Locations = v, "Locations List", "Can show list", false) }, { "Job.Lists.LongRunningJobs", new Tuple, Action, string, string, bool>(c => c.Job.Lists.LongRunningJobs, (c, v) => c.Job.Lists.LongRunningJobs = v, "Long Running Jobs List", "Can show list", false) }, { "Job.Lists.RecentlyClosed", new Tuple, Action, string, string, bool>(c => c.Job.Lists.RecentlyClosed, (c, v) => c.Job.Lists.RecentlyClosed = v, "Recently Closed List", "Can show list", false) }, { "Job.Actions.AddAttachments", new Tuple, Action, string, string, bool>(c => c.Job.Actions.AddAttachments, (c, v) => c.Job.Actions.AddAttachments = v, "Add Attachments", "Can add attachments to jobs", false) }, { "Job.Actions.AddLogs", new Tuple, Action, string, string, bool>(c => c.Job.Actions.AddLogs, (c, v) => c.Job.Actions.AddLogs = v, "Add Logs", "Can add job logs", false) }, { "Job.Actions.Close", new Tuple, Action, string, string, bool>(c => c.Job.Actions.Close, (c, v) => c.Job.Actions.Close = v, "Close Jobs", "Can close jobs", false) }, { "Job.Actions.ConvertHWarToHNWar", new Tuple, Action, string, string, bool>(c => c.Job.Actions.ConvertHWarToHNWar, (c, v) => c.Job.Actions.ConvertHWarToHNWar = v, "Convert HWar Jobs To HNWar", "Can convert warranty jobs to non-warranty jobs", false) }, { "Job.Actions.Create", new Tuple, Action, string, string, bool>(c => c.Job.Actions.Create, (c, v) => c.Job.Actions.Create = v, "Create Jobs", "Can create jobs", false) }, { "Job.Actions.Delete", new Tuple, Action, string, string, bool>(c => c.Job.Actions.Delete, (c, v) => c.Job.Actions.Delete = v, "Delete Jobs", "Can delete jobs", false) }, { "Job.Actions.ForceClose", new Tuple, Action, string, string, bool>(c => c.Job.Actions.ForceClose, (c, v) => c.Job.Actions.ForceClose = v, "Force Close Jobs", "Can force close jobs", false) }, { "Job.Actions.GenerateDocuments", new Tuple, Action, string, string, bool>(c => c.Job.Actions.GenerateDocuments, (c, v) => c.Job.Actions.GenerateDocuments = v, "Generate Documents", "Can generate documents for jobs", false) }, { "Job.Actions.LogRepair", new Tuple, Action, string, string, bool>(c => c.Job.Actions.LogRepair, (c, v) => c.Job.Actions.LogRepair = v, "Log Repair", "Can log repair for non-warranty jobs", false) }, { "Job.Actions.LogWarranty", new Tuple, Action, string, string, bool>(c => c.Job.Actions.LogWarranty, (c, v) => c.Job.Actions.LogWarranty = v, "Log Warranty", "Can log warranty for jobs", false) }, { "Job.Actions.RemoveAnyAttachments", new Tuple, Action, string, string, bool>(c => c.Job.Actions.RemoveAnyAttachments, (c, v) => c.Job.Actions.RemoveAnyAttachments = v, "Remove Any Attachments", "Can remove any attachments from jobs", false) }, { "Job.Actions.RemoveAnyLogs", new Tuple, Action, string, string, bool>(c => c.Job.Actions.RemoveAnyLogs, (c, v) => c.Job.Actions.RemoveAnyLogs = v, "Remove Any Logs", "Can remove any job logs", false) }, { "Job.Actions.RemoveOwnAttachments", new Tuple, Action, string, string, bool>(c => c.Job.Actions.RemoveOwnAttachments, (c, v) => c.Job.Actions.RemoveOwnAttachments = v, "Remove Own Attachments", "Can remove own attachments from jobs", false) }, { "Job.Actions.RemoveOwnLogs", new Tuple, Action, string, string, bool>(c => c.Job.Actions.RemoveOwnLogs, (c, v) => c.Job.Actions.RemoveOwnLogs = v, "Remove Own Logs", "Can remove own job logs", false) }, { "Job.Actions.Reopen", new Tuple, Action, string, string, bool>(c => c.Job.Actions.Reopen, (c, v) => c.Job.Actions.Reopen = v, "Reopen Jobs", "Can reopen jobs", false) }, { "Job.Actions.UpdateSubTypes", new Tuple, Action, string, string, bool>(c => c.Job.Actions.UpdateSubTypes, (c, v) => c.Job.Actions.UpdateSubTypes = v, "Update Sub Types", "Can update sub types for jobs", false) }, { "Job.Properties.WarrantyProperties.ExternalCompletedDate", new Tuple, Action, string, string, bool>(c => c.Job.Properties.WarrantyProperties.ExternalCompletedDate, (c, v) => c.Job.Properties.WarrantyProperties.ExternalCompletedDate = v, "External Completed Date Property", "Can update property", false) }, { "Job.Properties.WarrantyProperties.ExternalLoggedDate", new Tuple, Action, string, string, bool>(c => c.Job.Properties.WarrantyProperties.ExternalLoggedDate, (c, v) => c.Job.Properties.WarrantyProperties.ExternalLoggedDate = v, "External Logged Date Property", "Can update property", false) }, { "Job.Properties.WarrantyProperties.ExternalName", new Tuple, Action, string, string, bool>(c => c.Job.Properties.WarrantyProperties.ExternalName, (c, v) => c.Job.Properties.WarrantyProperties.ExternalName = v, "External Name Property", "Can update property", false) }, { "Job.Properties.WarrantyProperties.ExternalReference", new Tuple, Action, string, string, bool>(c => c.Job.Properties.WarrantyProperties.ExternalReference, (c, v) => c.Job.Properties.WarrantyProperties.ExternalReference = v, "External Reference Property", "Can update property", false) }, { "Job.Properties.WarrantyProperties.ProviderDetails", new Tuple, Action, string, string, bool>(c => c.Job.Properties.WarrantyProperties.ProviderDetails, (c, v) => c.Job.Properties.WarrantyProperties.ProviderDetails = v, "Provider Details", "Can access warranty provider details", false) }, { "Job.Properties.WarrantyProperties.WarrantyCompleted", new Tuple, Action, string, string, bool>(c => c.Job.Properties.WarrantyProperties.WarrantyCompleted, (c, v) => c.Job.Properties.WarrantyProperties.WarrantyCompleted = v, "Warranty Completed Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.AccountingChargeAdded", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.AccountingChargeAdded, (c, v) => c.Job.Properties.NonWarrantyProperties.AccountingChargeAdded = v, "Accounting Charge Added Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.AccountingChargePaid", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.AccountingChargePaid, (c, v) => c.Job.Properties.NonWarrantyProperties.AccountingChargePaid = v, "Accounting Charge Paid Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.AccountingChargeRequired", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.AccountingChargeRequired, (c, v) => c.Job.Properties.NonWarrantyProperties.AccountingChargeRequired = v, "Accounting Charge Required Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.AddComponents", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.AddComponents, (c, v) => c.Job.Properties.NonWarrantyProperties.AddComponents = v, "Add Components", "Can add job components (NOTE: Requires Edit Components)", false) }, { "Job.Properties.NonWarrantyProperties.EditComponents", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.EditComponents, (c, v) => c.Job.Properties.NonWarrantyProperties.EditComponents = v, "Edit Components", "Can edit and remove job components", false) }, { "Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent, (c, v) => c.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent = v, "Insurance Claim Form Sent Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.InsuranceDetails", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.InsuranceDetails, (c, v) => c.Job.Properties.NonWarrantyProperties.InsuranceDetails = v, "Insurance Detail Properties", "Can update insurance detail properties", false) }, { "Job.Properties.NonWarrantyProperties.InvoiceReceived", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.InvoiceReceived, (c, v) => c.Job.Properties.NonWarrantyProperties.InvoiceReceived = v, "Invoice Received Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.IsInsuranceClaim", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.IsInsuranceClaim, (c, v) => c.Job.Properties.NonWarrantyProperties.IsInsuranceClaim = v, "Is Insurance Claim Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.PurchaseOrderRaised", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.PurchaseOrderRaised, (c, v) => c.Job.Properties.NonWarrantyProperties.PurchaseOrderRaised = v, "Purchase Order Raised Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.PurchaseOrderReference", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.PurchaseOrderReference, (c, v) => c.Job.Properties.NonWarrantyProperties.PurchaseOrderReference = v, "Purchase Order Reference Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.PurchaseOrderSent", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.PurchaseOrderSent, (c, v) => c.Job.Properties.NonWarrantyProperties.PurchaseOrderSent = v, "Purchase Order Sent Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.RepairerCompletedDate", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.RepairerCompletedDate, (c, v) => c.Job.Properties.NonWarrantyProperties.RepairerCompletedDate = v, "Repairer Completed Date Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.RepairerLoggedDate", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.RepairerLoggedDate, (c, v) => c.Job.Properties.NonWarrantyProperties.RepairerLoggedDate = v, "Repairer Logged Date Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.RepairerName", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.RepairerName, (c, v) => c.Job.Properties.NonWarrantyProperties.RepairerName = v, "Repairer Name Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.RepairerReference", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.RepairerReference, (c, v) => c.Job.Properties.NonWarrantyProperties.RepairerReference = v, "Repairer Reference Property", "Can update property", false) }, { "Job.Properties.DeviceHeldLocation", new Tuple, Action, string, string, bool>(c => c.Job.Properties.DeviceHeldLocation, (c, v) => c.Job.Properties.DeviceHeldLocation = v, "Device Held Location Property", "Can update property", false) }, { "Job.Properties.DeviceHeld", new Tuple, Action, string, string, bool>(c => c.Job.Properties.DeviceHeld, (c, v) => c.Job.Properties.DeviceHeld = v, "Device Held Property", "Can update property", false) }, { "Job.Properties.DeviceReadyForReturn", new Tuple, Action, string, string, bool>(c => c.Job.Properties.DeviceReadyForReturn, (c, v) => c.Job.Properties.DeviceReadyForReturn = v, "Device Ready For Return Property", "Can update property", false) }, { "Job.Properties.DeviceReturned", new Tuple, Action, string, string, bool>(c => c.Job.Properties.DeviceReturned, (c, v) => c.Job.Properties.DeviceReturned = v, "Device Returned Property", "Can update property", false) }, { "Job.Properties.ExpectedClosedDate", new Tuple, Action, string, string, bool>(c => c.Job.Properties.ExpectedClosedDate, (c, v) => c.Job.Properties.ExpectedClosedDate = v, "Expected Closed Date Property", "Can update property", false) }, { "Job.Properties.Flags", new Tuple, Action, string, string, bool>(c => c.Job.Properties.Flags, (c, v) => c.Job.Properties.Flags = v, "Flags Property", "Can update property", false) }, { "Job.Properties.NotWaitingForUserAction", new Tuple, Action, string, string, bool>(c => c.Job.Properties.NotWaitingForUserAction, (c, v) => c.Job.Properties.NotWaitingForUserAction = v, "Not Waiting For User Action Property", "Can update property", false) }, { "Job.Properties.WaitingForUserAction", new Tuple, Action, string, string, bool>(c => c.Job.Properties.WaitingForUserAction, (c, v) => c.Job.Properties.WaitingForUserAction = v, "Waiting For User Action Property", "Can update property", false) }, { "Job.Types.ShowHMisc", new Tuple, Action, string, string, bool>(c => c.Job.Types.ShowHMisc, (c, v) => c.Job.Types.ShowHMisc = v, "Show Hardware - Miscellaneous Jobs", "Can show jobs of this type", false) }, { "Job.Types.ShowHNWar", new Tuple, Action, string, string, bool>(c => c.Job.Types.ShowHNWar, (c, v) => c.Job.Types.ShowHNWar = v, "Show Hardware - Non-Warranty Jobs", "Can show jobs of this type", false) }, { "Job.Types.ShowHWar", new Tuple, Action, string, string, bool>(c => c.Job.Types.ShowHWar, (c, v) => c.Job.Types.ShowHWar = v, "Show Hardware - Warranty Jobs", "Can show jobs of this type", false) }, { "Job.Types.ShowSApp", new Tuple, Action, string, string, bool>(c => c.Job.Types.ShowSApp, (c, v) => c.Job.Types.ShowSApp = v, "Show Software - Application Jobs", "Can show jobs of this type", false) }, { "Job.Types.ShowSOS", new Tuple, Action, string, string, bool>(c => c.Job.Types.ShowSOS, (c, v) => c.Job.Types.ShowSOS = v, "Show Software - Operating System Jobs", "Can show jobs of this type", false) }, { "Job.Types.ShowSImg", new Tuple, Action, string, string, bool>(c => c.Job.Types.ShowSImg, (c, v) => c.Job.Types.ShowSImg = v, "Show Software - Reimage Jobs", "Can show jobs of this type", false) }, { "Job.Types.ShowUMgmt", new Tuple, Action, string, string, bool>(c => c.Job.Types.ShowUMgmt, (c, v) => c.Job.Types.ShowUMgmt = v, "Show User Management Jobs", "Can show jobs of this type", false) }, { "Job.Search", new Tuple, Action, string, string, bool>(c => c.Job.Search, (c, v) => c.Job.Search = v, "Search Jobs", "Can search jobs", false) }, { "Job.ShowAttachments", new Tuple, Action, string, string, bool>(c => c.Job.ShowAttachments, (c, v) => c.Job.ShowAttachments = v, "Show Attachments", "Can show job attachments", false) }, { "Job.ShowDailyChart", new Tuple, Action, string, string, bool>(c => c.Job.ShowDailyChart, (c, v) => c.Job.ShowDailyChart = v, "Show Daily Opened & Closed", "Can show daily opened & closed chart", false) }, { "Job.ShowFlags", new Tuple, Action, string, string, bool>(c => c.Job.ShowFlags, (c, v) => c.Job.ShowFlags = v, "Show Flags", "Can show job flags", false) }, { "Job.Show", new Tuple, Action, string, string, bool>(c => c.Job.Show, (c, v) => c.Job.Show = v, "Show Jobs", "Can show jobs", false) }, { "Job.ShowLogs", new Tuple, Action, string, string, bool>(c => c.Job.ShowLogs, (c, v) => c.Job.ShowLogs = v, "Show Logs", "Can show job logs", false) }, { "Job.ShowNonWarrantyComponents", new Tuple, Action, string, string, bool>(c => c.Job.ShowNonWarrantyComponents, (c, v) => c.Job.ShowNonWarrantyComponents = v, "Show Non-Warranty Components", "Can show non-warranty job components", false) }, { "Job.ShowNonWarrantyFinance", new Tuple, Action, string, string, bool>(c => c.Job.ShowNonWarrantyFinance, (c, v) => c.Job.ShowNonWarrantyFinance = v, "Show Non-Warranty Finance", "Can show non-warranty job finance", false) }, { "Job.ShowNonWarrantyInsurance", new Tuple, Action, string, string, bool>(c => c.Job.ShowNonWarrantyInsurance, (c, v) => c.Job.ShowNonWarrantyInsurance = v, "Show Non-Warranty Insurance", "Can show non-warranty job insurance", false) }, { "Job.ShowNonWarrantyRepairs", new Tuple, Action, string, string, bool>(c => c.Job.ShowNonWarrantyRepairs, (c, v) => c.Job.ShowNonWarrantyRepairs = v, "Show Non-Warranty Repairs", "Can show non-warranty job repairs", false) }, { "Job.ShowWarranty", new Tuple, Action, string, string, bool>(c => c.Job.ShowWarranty, (c, v) => c.Job.ShowWarranty = v, "Show Warranty", "Can show job warranty", false) }, { "Device.Properties.AssetNumber", new Tuple, Action, string, string, bool>(c => c.Device.Properties.AssetNumber, (c, v) => c.Device.Properties.AssetNumber = v, "Asset Number Property", "Can update property", false) }, { "Device.Properties.Details", new Tuple, Action, string, string, bool>(c => c.Device.Properties.Details, (c, v) => c.Device.Properties.Details = v, "Detail Properties", "Can update detail properties", false) }, { "Device.Properties.DeviceBatch", new Tuple, Action, string, string, bool>(c => c.Device.Properties.DeviceBatch, (c, v) => c.Device.Properties.DeviceBatch = v, "Device Batch Property", "Can update property", false) }, { "Device.Properties.DeviceProfile", new Tuple, Action, string, string, bool>(c => c.Device.Properties.DeviceProfile, (c, v) => c.Device.Properties.DeviceProfile = v, "Device Profile Property", "Can update property", false) }, { "Device.Properties.Location", new Tuple, Action, string, string, bool>(c => c.Device.Properties.Location, (c, v) => c.Device.Properties.Location = v, "Location Property", "Can update property", false) }, { "Device.Actions.AddAttachments", new Tuple, Action, string, string, bool>(c => c.Device.Actions.AddAttachments, (c, v) => c.Device.Actions.AddAttachments = v, "Add Attachments", "Can add attachments to devices", false) }, { "Device.Actions.AllowUnauthenticatedEnrol", new Tuple, Action, string, string, bool>(c => c.Device.Actions.AllowUnauthenticatedEnrol, (c, v) => c.Device.Actions.AllowUnauthenticatedEnrol = v, "Allow Unauthenticated Enrol", "Can allow devices to enrol without authentication", false) }, { "Device.Actions.AssignUser", new Tuple, Action, string, string, bool>(c => c.Device.Actions.AssignUser, (c, v) => c.Device.Actions.AssignUser = v, "Assign User", "Can update the user assignment of devices", false) }, { "Device.Actions.Decommission", new Tuple, Action, string, string, bool>(c => c.Device.Actions.Decommission, (c, v) => c.Device.Actions.Decommission = v, "Decommission", "Can decommission devices", false) }, { "Device.Actions.Delete", new Tuple, Action, string, string, bool>(c => c.Device.Actions.Delete, (c, v) => c.Device.Actions.Delete = v, "Delete", "Can delete devices", false) }, { "Device.Actions.EnrolDevices", new Tuple, Action, string, string, bool>(c => c.Device.Actions.EnrolDevices, (c, v) => c.Device.Actions.EnrolDevices = v, "Enrol Devices", "Can add devices offline and enrol devices with the Bootstrapper", false) }, { "Device.Actions.Export", new Tuple, Action, string, string, bool>(c => c.Device.Actions.Export, (c, v) => c.Device.Actions.Export = v, "Export Devices", "Can export devices in a bulk format", false) }, { "Device.Actions.GenerateDocuments", new Tuple, Action, string, string, bool>(c => c.Device.Actions.GenerateDocuments, (c, v) => c.Device.Actions.GenerateDocuments = v, "Generate Documents", "Can generate documents for jobs", false) }, { "Device.Actions.Import", new Tuple, Action, string, string, bool>(c => c.Device.Actions.Import, (c, v) => c.Device.Actions.Import = v, "Import Devices", "Can bulk import devices", false) }, { "Device.Actions.Recommission", new Tuple, Action, string, string, bool>(c => c.Device.Actions.Recommission, (c, v) => c.Device.Actions.Recommission = v, "Recommission", "Can recommission devices", false) }, { "Device.Actions.RemoveAnyAttachments", new Tuple, Action, string, string, bool>(c => c.Device.Actions.RemoveAnyAttachments, (c, v) => c.Device.Actions.RemoveAnyAttachments = v, "Remove Any Attachments", "Can remove any attachments from devices", false) }, { "Device.Actions.RemoveOwnAttachments", new Tuple, Action, string, string, bool>(c => c.Device.Actions.RemoveOwnAttachments, (c, v) => c.Device.Actions.RemoveOwnAttachments = v, "Remove Own Attachments", "Can remove own attachments from devices", false) }, { "Device.Search", new Tuple, Action, string, string, bool>(c => c.Device.Search, (c, v) => c.Device.Search = v, "Search Devices", "Can search devices", false) }, { "Device.ShowAssignmentHistory", new Tuple, Action, string, string, bool>(c => c.Device.ShowAssignmentHistory, (c, v) => c.Device.ShowAssignmentHistory = v, "Show Assignment History", "Can show the assignment history for devices", false) }, { "Device.ShowAttachments", new Tuple, Action, string, string, bool>(c => c.Device.ShowAttachments, (c, v) => c.Device.ShowAttachments = v, "Show Attachments", "Can show device attachments", false) }, { "Device.ShowCertificates", new Tuple, Action, string, string, bool>(c => c.Device.ShowCertificates, (c, v) => c.Device.ShowCertificates = v, "Show Certificates", "Can show certificates associated with devices", false) }, { "Device.ShowDetails", new Tuple, Action, string, string, bool>(c => c.Device.ShowDetails, (c, v) => c.Device.ShowDetails = v, "Show Details", "Can show details associated with devices", false) }, { "Device.Show", new Tuple, Action, string, string, bool>(c => c.Device.Show, (c, v) => c.Device.Show = v, "Show Devices", "Can show devices", false) }, { "Device.ShowJobs", new Tuple, Action, string, string, bool>(c => c.Device.ShowJobs, (c, v) => c.Device.ShowJobs = v, "Show Devices Jobs", "Can show jobs associated with devices", false) }, { "User.Actions.AddAttachments", new Tuple, Action, string, string, bool>(c => c.User.Actions.AddAttachments, (c, v) => c.User.Actions.AddAttachments = v, "Add Attachments", "Can add attachments to users", false) }, { "User.Actions.GenerateDocuments", new Tuple, Action, string, string, bool>(c => c.User.Actions.GenerateDocuments, (c, v) => c.User.Actions.GenerateDocuments = v, "Generate Documents", "Can generate documents for users", false) }, { "User.Actions.RemoveAnyAttachments", new Tuple, Action, string, string, bool>(c => c.User.Actions.RemoveAnyAttachments, (c, v) => c.User.Actions.RemoveAnyAttachments = v, "Remove Any Attachments", "Can remove any attachments from users", false) }, { "User.Actions.RemoveOwnAttachments", new Tuple, Action, string, string, bool>(c => c.User.Actions.RemoveOwnAttachments, (c, v) => c.User.Actions.RemoveOwnAttachments = v, "Remove Own Attachments", "Can remove own attachments from users", false) }, { "User.Search", new Tuple, Action, string, string, bool>(c => c.User.Search, (c, v) => c.User.Search = v, "Search Users", "Can search users", false) }, { "User.ShowAttachments", new Tuple, Action, string, string, bool>(c => c.User.ShowAttachments, (c, v) => c.User.ShowAttachments = v, "Show Attachments", "Can show user attachments", false) }, { "User.ShowAssignmentHistory", new Tuple, Action, string, string, bool>(c => c.User.ShowAssignmentHistory, (c, v) => c.User.ShowAssignmentHistory = v, "Show Device Assignment History", "Can show the device assignment history for users", false) }, { "User.Show", new Tuple, Action, string, string, bool>(c => c.User.Show, (c, v) => c.User.Show = v, "Show Users", "Can show users", false) }, { "User.ShowAuthorization", new Tuple, Action, string, string, bool>(c => c.User.ShowAuthorization, (c, v) => c.User.ShowAuthorization = v, "Show Users Authorization", "Can show authorization permissions associated with users", false) }, { "User.ShowJobs", new Tuple, Action, string, string, bool>(c => c.User.ShowJobs, (c, v) => c.User.ShowJobs = v, "Show Users Jobs", "Can show jobs associated with users", false) }, { "ComputerAccount", new Tuple, Action, string, string, bool>(c => c.ComputerAccount, (c, v) => c.ComputerAccount = v, "Computer Account", "Represents a computer account", true) }, { "DiscoAdminAccount", new Tuple, Action, string, string, bool>(c => c.DiscoAdminAccount, (c, v) => c.DiscoAdminAccount = v, "Disco Administrator Account", "Represents a Disco Administrator account", true) } }; #endregion #region Role Claim Navigator _claimNavigator = new ClaimNavigatorItem("Claims", "Permissions", "Top-level node for all permissions", false, new List() { new ClaimNavigatorItem("Config", "Configuration", "Permissions related to Disco Configuration", false, new List() { new ClaimNavigatorItem("Config.DeviceCertificate", "Device Certificate", "Permissions related to Device Certificates", false, new List() { new ClaimNavigatorItem("Config.DeviceCertificate.DownloadCertificates", false) }), new ClaimNavigatorItem("Config.Enrolment", "Enrolment", "Permissions related to Device Enrolment", false, new List() { new ClaimNavigatorItem("Config.Enrolment.Configure", false), new ClaimNavigatorItem("Config.Enrolment.DownloadBootstrapper", false), new ClaimNavigatorItem("Config.Enrolment.Show", false), new ClaimNavigatorItem("Config.Enrolment.ShowStatus", false) }), new ClaimNavigatorItem("Config.DeviceBatch", "Device Batch", "Permissions related to Device Batches", false, new List() { new ClaimNavigatorItem("Config.DeviceBatch.Configure", false), new ClaimNavigatorItem("Config.DeviceBatch.Create", false), new ClaimNavigatorItem("Config.DeviceBatch.Delete", false), new ClaimNavigatorItem("Config.DeviceBatch.Show", false), new ClaimNavigatorItem("Config.DeviceBatch.ShowTimeline", false) }), new ClaimNavigatorItem("Config.DeviceModel", "Device Model", "Permissions related to Device Models", false, new List() { new ClaimNavigatorItem("Config.DeviceModel.ConfigureComponents", false), new ClaimNavigatorItem("Config.DeviceModel.Configure", false), new ClaimNavigatorItem("Config.DeviceModel.Delete", false), new ClaimNavigatorItem("Config.DeviceModel.Show", false) }), new ClaimNavigatorItem("Config.DeviceProfile", "Device Profile", "Permissions related to Device Profiles", false, new List() { new ClaimNavigatorItem("Config.DeviceProfile.ConfigureComputerNameTemplate", false), new ClaimNavigatorItem("Config.DeviceProfile.ConfigureDefaults", false), new ClaimNavigatorItem("Config.DeviceProfile.Configure", false), new ClaimNavigatorItem("Config.DeviceProfile.Create", false), new ClaimNavigatorItem("Config.DeviceProfile.Delete", false), new ClaimNavigatorItem("Config.DeviceProfile.Show", false) }), new ClaimNavigatorItem("Config.DocumentTemplate", "Document Template", "Permissions related to Document Templates", false, new List() { new ClaimNavigatorItem("Config.DocumentTemplate.BulkGenerate", false), new ClaimNavigatorItem("Config.DocumentTemplate.Configure", false), new ClaimNavigatorItem("Config.DocumentTemplate.ConfigureFilterExpression", false), new ClaimNavigatorItem("Config.DocumentTemplate.Create", false), new ClaimNavigatorItem("Config.DocumentTemplate.Delete", false), new ClaimNavigatorItem("Config.DocumentTemplate.ShowStatus", false), new ClaimNavigatorItem("Config.DocumentTemplate.Show", false), new ClaimNavigatorItem("Config.DocumentTemplate.UndetectedPages", false), new ClaimNavigatorItem("Config.DocumentTemplate.Upload", false) }), new ClaimNavigatorItem("Config.Logging", "Logging", "Permissions related to Logging", false, new List() { new ClaimNavigatorItem("Config.Logging.Show", false) }), new ClaimNavigatorItem("Config.Plugin", "Plugin", "Permissions related to Plugins", false, new List() { new ClaimNavigatorItem("Config.Plugin.Configure", false), new ClaimNavigatorItem("Config.Plugin.InstallLocal", false), new ClaimNavigatorItem("Config.Plugin.Install", false), new ClaimNavigatorItem("Config.Plugin.Show", false), new ClaimNavigatorItem("Config.Plugin.Uninstall", false) }), new ClaimNavigatorItem("Config.System", "System", "Permissions related to System Configuration", false, new List() { new ClaimNavigatorItem("Config.System.ConfigureProxy", false), new ClaimNavigatorItem("Config.System.Show", false) }), new ClaimNavigatorItem("Config.Organisation", "Organisation Details", "Permissions related to the Organisation Details", false, new List() { new ClaimNavigatorItem("Config.Organisation.ConfigureAddresses", false), new ClaimNavigatorItem("Config.Organisation.ConfigureLogo", false), new ClaimNavigatorItem("Config.Organisation.ConfigureMultiSiteMode", false), new ClaimNavigatorItem("Config.Organisation.ConfigureName", false), new ClaimNavigatorItem("Config.Organisation.Show", false) }), new ClaimNavigatorItem("Config.JobPreferences", "Job Preferences", "Permissions related to Job Preferences", false, new List() { new ClaimNavigatorItem("Config.JobPreferences.Configure", false), new ClaimNavigatorItem("Config.JobPreferences.Show", false) }), new ClaimNavigatorItem("Config.Show", false) }), new ClaimNavigatorItem("Job", "Job", "Permissions related to Jobs", false, new List() { new ClaimNavigatorItem("Job.Lists", "Lists", "Permissions related to Job Lists", false, new List() { new ClaimNavigatorItem("Job.Lists.AllOpen", false), new ClaimNavigatorItem("Job.Lists.AwaitingFinanceAgreementBreach", false), new ClaimNavigatorItem("Job.Lists.AwaitingFinanceCharge", false), new ClaimNavigatorItem("Job.Lists.AwaitingFinanceInsuranceProcessing", false), new ClaimNavigatorItem("Job.Lists.AwaitingFinance", false), new ClaimNavigatorItem("Job.Lists.AwaitingFinancePayment", false), new ClaimNavigatorItem("Job.Lists.AwaitingTechnicianAction", false), new ClaimNavigatorItem("Job.Lists.AwaitingUserAction", false), new ClaimNavigatorItem("Job.Lists.DevicesAwaitingRepair", false), new ClaimNavigatorItem("Job.Lists.DevicesReadyForReturn", false), new ClaimNavigatorItem("Job.Lists.Locations", false), new ClaimNavigatorItem("Job.Lists.LongRunningJobs", false), new ClaimNavigatorItem("Job.Lists.RecentlyClosed", false) }), new ClaimNavigatorItem("Job.Actions", "Actions", "Permissions related to Job Actions", false, new List() { new ClaimNavigatorItem("Job.Actions.AddAttachments", false), new ClaimNavigatorItem("Job.Actions.AddLogs", false), new ClaimNavigatorItem("Job.Actions.Close", false), new ClaimNavigatorItem("Job.Actions.ConvertHWarToHNWar", false), new ClaimNavigatorItem("Job.Actions.Create", false), new ClaimNavigatorItem("Job.Actions.Delete", false), new ClaimNavigatorItem("Job.Actions.ForceClose", false), new ClaimNavigatorItem("Job.Actions.GenerateDocuments", false), new ClaimNavigatorItem("Job.Actions.LogRepair", false), new ClaimNavigatorItem("Job.Actions.LogWarranty", false), new ClaimNavigatorItem("Job.Actions.RemoveAnyAttachments", false), new ClaimNavigatorItem("Job.Actions.RemoveAnyLogs", false), new ClaimNavigatorItem("Job.Actions.RemoveOwnAttachments", false), new ClaimNavigatorItem("Job.Actions.RemoveOwnLogs", false), new ClaimNavigatorItem("Job.Actions.Reopen", false), new ClaimNavigatorItem("Job.Actions.UpdateSubTypes", false) }), new ClaimNavigatorItem("Job.Properties", "Job Properties", "Permissions related to Job Properties", false, new List() { new ClaimNavigatorItem("Job.Properties.WarrantyProperties", "Warranty Properties", "Permissions related to Warranty Job Properties", false, new List() { new ClaimNavigatorItem("Job.Properties.WarrantyProperties.ExternalCompletedDate", false), new ClaimNavigatorItem("Job.Properties.WarrantyProperties.ExternalLoggedDate", false), new ClaimNavigatorItem("Job.Properties.WarrantyProperties.ExternalName", false), new ClaimNavigatorItem("Job.Properties.WarrantyProperties.ExternalReference", false), new ClaimNavigatorItem("Job.Properties.WarrantyProperties.ProviderDetails", false), new ClaimNavigatorItem("Job.Properties.WarrantyProperties.WarrantyCompleted", false) }), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties", "Non Warranty Properties", "Permissions related to Non-Warranty Job Properties", false, new List() { new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.AccountingChargeAdded", false), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.AccountingChargePaid", false), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.AccountingChargeRequired", false), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.AddComponents", false), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.EditComponents", false), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent", false), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.InsuranceDetails", false), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.InvoiceReceived", false), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.IsInsuranceClaim", false), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.PurchaseOrderRaised", false), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.PurchaseOrderReference", false), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.PurchaseOrderSent", false), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.RepairerCompletedDate", false), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.RepairerLoggedDate", false), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.RepairerName", false), new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.RepairerReference", false) }), new ClaimNavigatorItem("Job.Properties.DeviceHeldLocation", false), new ClaimNavigatorItem("Job.Properties.DeviceHeld", false), new ClaimNavigatorItem("Job.Properties.DeviceReadyForReturn", false), new ClaimNavigatorItem("Job.Properties.DeviceReturned", false), new ClaimNavigatorItem("Job.Properties.ExpectedClosedDate", false), new ClaimNavigatorItem("Job.Properties.Flags", false), new ClaimNavigatorItem("Job.Properties.NotWaitingForUserAction", false), new ClaimNavigatorItem("Job.Properties.WaitingForUserAction", false) }), new ClaimNavigatorItem("Job.Types", "Types", "Permissions related to Job Types", false, new List() { new ClaimNavigatorItem("Job.Types.ShowHMisc", false), new ClaimNavigatorItem("Job.Types.ShowHNWar", false), new ClaimNavigatorItem("Job.Types.ShowHWar", false), new ClaimNavigatorItem("Job.Types.ShowSApp", false), new ClaimNavigatorItem("Job.Types.ShowSOS", false), new ClaimNavigatorItem("Job.Types.ShowSImg", false), new ClaimNavigatorItem("Job.Types.ShowUMgmt", false) }), new ClaimNavigatorItem("Job.Search", false), new ClaimNavigatorItem("Job.ShowAttachments", false), new ClaimNavigatorItem("Job.ShowDailyChart", false), new ClaimNavigatorItem("Job.ShowFlags", false), new ClaimNavigatorItem("Job.Show", false), new ClaimNavigatorItem("Job.ShowLogs", false), new ClaimNavigatorItem("Job.ShowNonWarrantyComponents", false), new ClaimNavigatorItem("Job.ShowNonWarrantyFinance", false), new ClaimNavigatorItem("Job.ShowNonWarrantyInsurance", false), new ClaimNavigatorItem("Job.ShowNonWarrantyRepairs", false), new ClaimNavigatorItem("Job.ShowWarranty", false) }), new ClaimNavigatorItem("Device", "Device", "Permissions related to Devices", false, new List() { new ClaimNavigatorItem("Device.Properties", "Device Properties", "Permissions related to Device Properties", false, new List() { new ClaimNavigatorItem("Device.Properties.AssetNumber", false), new ClaimNavigatorItem("Device.Properties.Details", false), new ClaimNavigatorItem("Device.Properties.DeviceBatch", false), new ClaimNavigatorItem("Device.Properties.DeviceProfile", false), new ClaimNavigatorItem("Device.Properties.Location", false) }), new ClaimNavigatorItem("Device.Actions", "Actions", "Permissions related to Device Actions", false, new List() { new ClaimNavigatorItem("Device.Actions.AddAttachments", false), new ClaimNavigatorItem("Device.Actions.AllowUnauthenticatedEnrol", false), new ClaimNavigatorItem("Device.Actions.AssignUser", false), new ClaimNavigatorItem("Device.Actions.Decommission", false), new ClaimNavigatorItem("Device.Actions.Delete", false), new ClaimNavigatorItem("Device.Actions.EnrolDevices", false), new ClaimNavigatorItem("Device.Actions.Export", false), new ClaimNavigatorItem("Device.Actions.GenerateDocuments", false), new ClaimNavigatorItem("Device.Actions.Import", false), new ClaimNavigatorItem("Device.Actions.Recommission", false), new ClaimNavigatorItem("Device.Actions.RemoveAnyAttachments", false), new ClaimNavigatorItem("Device.Actions.RemoveOwnAttachments", false) }), new ClaimNavigatorItem("Device.Search", false), new ClaimNavigatorItem("Device.ShowAssignmentHistory", false), new ClaimNavigatorItem("Device.ShowAttachments", false), new ClaimNavigatorItem("Device.ShowCertificates", false), new ClaimNavigatorItem("Device.ShowDetails", false), new ClaimNavigatorItem("Device.Show", false), new ClaimNavigatorItem("Device.ShowJobs", false) }), new ClaimNavigatorItem("User", "User", "Permissions related to Users", false, new List() { new ClaimNavigatorItem("User.Actions", "Actions", "Permissions related to User Actions", false, new List() { new ClaimNavigatorItem("User.Actions.AddAttachments", false), new ClaimNavigatorItem("User.Actions.GenerateDocuments", false), new ClaimNavigatorItem("User.Actions.RemoveAnyAttachments", false), new ClaimNavigatorItem("User.Actions.RemoveOwnAttachments", false) }), new ClaimNavigatorItem("User.Search", false), new ClaimNavigatorItem("User.ShowAttachments", false), new ClaimNavigatorItem("User.ShowAssignmentHistory", false), new ClaimNavigatorItem("User.Show", false), new ClaimNavigatorItem("User.ShowAuthorization", false), new ClaimNavigatorItem("User.ShowJobs", false) }), new ClaimNavigatorItem("ComputerAccount", true), new ClaimNavigatorItem("DiscoAdminAccount", true) }); #endregion } public static ClaimNavigatorItem RoleClaimNavigator { get { return _claimNavigator; } } internal static Tuple, Action, string, string, bool> GetClaimDefinition(string ClaimKey) { Tuple, Action, string, string, bool> claimDef; if (!_roleClaims.TryGetValue(ClaimKey, out claimDef)) throw new ArgumentException("Unknown Claim Key", "ClaimKey"); return new Tuple, Action, string, string, bool>(claimDef.Item1, claimDef.Item2, claimDef.Item3, claimDef.Item4, claimDef.Item5); } public static Func GetClaimAccessor(string ClaimKey) { Tuple, Action, string, string, bool> claimDef; if (!_roleClaims.TryGetValue(ClaimKey, out claimDef)) throw new ArgumentException("Unknown Claim Key", "ClaimKey"); return claimDef.Item1; } public static Action GetClaimSetter(string ClaimKey) { Tuple, Action, string, string, bool> claimDef; if (!_roleClaims.TryGetValue(ClaimKey, out claimDef)) throw new ArgumentException("Unknown Claim Key", "ClaimKey"); return claimDef.Item2; } public static Tuple GetClaimDetails(string ClaimKey) { Tuple, Action, string, string, bool> claimDef; if (!_roleClaims.TryGetValue(ClaimKey, out claimDef)) throw new ArgumentException("Unknown Claim Key", "ClaimKey"); return new Tuple(claimDef.Item3, claimDef.Item4, claimDef.Item5); } public static RoleClaims BuildClaims(IEnumerable ClaimKeys){ var c = new RoleClaims(); foreach (var claimKey in ClaimKeys) c.Set(claimKey, true); return c; } public static List GetClaimKeys(RoleClaims Claims) { var claims = Claims; return _roleClaims.Where(rc => rc.Value.Item1(claims)).Select(rc => rc.Key).ToList(); } public static RoleClaims AdministratorClaims() { var c = new RoleClaims(); #region Set All Administrator Claims c.Config.DeviceCertificate.DownloadCertificates = true; c.Config.Enrolment.Configure = true; c.Config.Enrolment.DownloadBootstrapper = true; c.Config.Enrolment.Show = true; c.Config.Enrolment.ShowStatus = true; c.Config.DeviceBatch.Configure = true; c.Config.DeviceBatch.Create = true; c.Config.DeviceBatch.Delete = true; c.Config.DeviceBatch.Show = true; c.Config.DeviceBatch.ShowTimeline = true; c.Config.DeviceModel.ConfigureComponents = true; c.Config.DeviceModel.Configure = true; c.Config.DeviceModel.Delete = true; c.Config.DeviceModel.Show = true; c.Config.DeviceProfile.ConfigureComputerNameTemplate = true; c.Config.DeviceProfile.ConfigureDefaults = true; c.Config.DeviceProfile.Configure = true; c.Config.DeviceProfile.Create = true; c.Config.DeviceProfile.Delete = true; c.Config.DeviceProfile.Show = true; c.Config.DocumentTemplate.BulkGenerate = true; c.Config.DocumentTemplate.Configure = true; c.Config.DocumentTemplate.ConfigureFilterExpression = true; c.Config.DocumentTemplate.Create = true; c.Config.DocumentTemplate.Delete = true; c.Config.DocumentTemplate.ShowStatus = true; c.Config.DocumentTemplate.Show = true; c.Config.DocumentTemplate.UndetectedPages = true; c.Config.DocumentTemplate.Upload = true; c.Config.Logging.Show = true; c.Config.Plugin.Configure = true; c.Config.Plugin.InstallLocal = true; c.Config.Plugin.Install = true; c.Config.Plugin.Show = true; c.Config.Plugin.Uninstall = true; c.Config.System.ConfigureProxy = true; c.Config.System.Show = true; c.Config.Organisation.ConfigureAddresses = true; c.Config.Organisation.ConfigureLogo = true; c.Config.Organisation.ConfigureMultiSiteMode = true; c.Config.Organisation.ConfigureName = true; c.Config.Organisation.Show = true; c.Config.JobPreferences.Configure = true; c.Config.JobPreferences.Show = true; c.Config.Show = true; c.Job.Lists.AllOpen = true; c.Job.Lists.AwaitingFinanceAgreementBreach = true; c.Job.Lists.AwaitingFinanceCharge = true; c.Job.Lists.AwaitingFinanceInsuranceProcessing = true; c.Job.Lists.AwaitingFinance = true; c.Job.Lists.AwaitingFinancePayment = true; c.Job.Lists.AwaitingTechnicianAction = true; c.Job.Lists.AwaitingUserAction = true; c.Job.Lists.DevicesAwaitingRepair = true; c.Job.Lists.DevicesReadyForReturn = true; c.Job.Lists.Locations = true; c.Job.Lists.LongRunningJobs = true; c.Job.Lists.RecentlyClosed = true; c.Job.Actions.AddAttachments = true; c.Job.Actions.AddLogs = true; c.Job.Actions.Close = true; c.Job.Actions.ConvertHWarToHNWar = true; c.Job.Actions.Create = true; c.Job.Actions.Delete = true; c.Job.Actions.ForceClose = true; c.Job.Actions.GenerateDocuments = true; c.Job.Actions.LogRepair = true; c.Job.Actions.LogWarranty = true; c.Job.Actions.RemoveAnyAttachments = true; c.Job.Actions.RemoveAnyLogs = true; c.Job.Actions.RemoveOwnAttachments = true; c.Job.Actions.RemoveOwnLogs = true; c.Job.Actions.Reopen = true; c.Job.Actions.UpdateSubTypes = true; c.Job.Properties.WarrantyProperties.ExternalCompletedDate = true; c.Job.Properties.WarrantyProperties.ExternalLoggedDate = true; c.Job.Properties.WarrantyProperties.ExternalName = true; c.Job.Properties.WarrantyProperties.ExternalReference = true; c.Job.Properties.WarrantyProperties.ProviderDetails = true; c.Job.Properties.WarrantyProperties.WarrantyCompleted = true; c.Job.Properties.NonWarrantyProperties.AccountingChargeAdded = true; c.Job.Properties.NonWarrantyProperties.AccountingChargePaid = true; c.Job.Properties.NonWarrantyProperties.AccountingChargeRequired = true; c.Job.Properties.NonWarrantyProperties.AddComponents = true; c.Job.Properties.NonWarrantyProperties.EditComponents = true; c.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent = true; c.Job.Properties.NonWarrantyProperties.InsuranceDetails = true; c.Job.Properties.NonWarrantyProperties.InvoiceReceived = true; c.Job.Properties.NonWarrantyProperties.IsInsuranceClaim = true; c.Job.Properties.NonWarrantyProperties.PurchaseOrderRaised = true; c.Job.Properties.NonWarrantyProperties.PurchaseOrderReference = true; c.Job.Properties.NonWarrantyProperties.PurchaseOrderSent = true; c.Job.Properties.NonWarrantyProperties.RepairerCompletedDate = true; c.Job.Properties.NonWarrantyProperties.RepairerLoggedDate = true; c.Job.Properties.NonWarrantyProperties.RepairerName = true; c.Job.Properties.NonWarrantyProperties.RepairerReference = true; c.Job.Properties.DeviceHeldLocation = true; c.Job.Properties.DeviceHeld = true; c.Job.Properties.DeviceReadyForReturn = true; c.Job.Properties.DeviceReturned = true; c.Job.Properties.ExpectedClosedDate = true; c.Job.Properties.Flags = true; c.Job.Properties.NotWaitingForUserAction = true; c.Job.Properties.WaitingForUserAction = true; c.Job.Types.ShowHMisc = true; c.Job.Types.ShowHNWar = true; c.Job.Types.ShowHWar = true; c.Job.Types.ShowSApp = true; c.Job.Types.ShowSOS = true; c.Job.Types.ShowSImg = true; c.Job.Types.ShowUMgmt = true; c.Job.Search = true; c.Job.ShowAttachments = true; c.Job.ShowDailyChart = true; c.Job.ShowFlags = true; c.Job.Show = true; c.Job.ShowLogs = true; c.Job.ShowNonWarrantyComponents = true; c.Job.ShowNonWarrantyFinance = true; c.Job.ShowNonWarrantyInsurance = true; c.Job.ShowNonWarrantyRepairs = true; c.Job.ShowWarranty = true; c.Device.Properties.AssetNumber = true; c.Device.Properties.Details = true; c.Device.Properties.DeviceBatch = true; c.Device.Properties.DeviceProfile = true; c.Device.Properties.Location = true; c.Device.Actions.AddAttachments = true; c.Device.Actions.AllowUnauthenticatedEnrol = true; c.Device.Actions.AssignUser = true; c.Device.Actions.Decommission = true; c.Device.Actions.Delete = true; c.Device.Actions.EnrolDevices = true; c.Device.Actions.Export = true; c.Device.Actions.GenerateDocuments = true; c.Device.Actions.Import = true; c.Device.Actions.Recommission = true; c.Device.Actions.RemoveAnyAttachments = true; c.Device.Actions.RemoveOwnAttachments = true; c.Device.Search = true; c.Device.ShowAssignmentHistory = true; c.Device.ShowAttachments = true; c.Device.ShowCertificates = true; c.Device.ShowDetails = true; c.Device.Show = true; c.Device.ShowJobs = true; c.User.Actions.AddAttachments = true; c.User.Actions.GenerateDocuments = true; c.User.Actions.RemoveAnyAttachments = true; c.User.Actions.RemoveOwnAttachments = true; c.User.Search = true; c.User.ShowAttachments = true; c.User.ShowAssignmentHistory = true; c.User.Show = true; c.User.ShowAuthorization = true; c.User.ShowJobs = true; c.DiscoAdminAccount = true; #endregion return c; } public static RoleClaims ComputerAccountClaims() { return new RoleClaims() { ComputerAccount = true }; } #region Role Claim Constants /// Configuration /// Permissions related to Disco Configuration /// public static class Config { /// Device Certificate /// Permissions related to Device Certificates /// public static class DeviceCertificate { /// Download Certificates /// Can download certificates /// public const string DownloadCertificates = "Config.DeviceCertificate.DownloadCertificates"; } /// Enrolment /// Permissions related to Device Enrolment /// public static class Enrolment { /// Configure Enrolment /// Can configure device enrolment /// public const string Configure = "Config.Enrolment.Configure"; /// Download Bootstrapper /// Can download the Device Bootstrapper /// public const string DownloadBootstrapper = "Config.Enrolment.DownloadBootstrapper"; /// Show Enrolment /// Can show device enrolment /// public const string Show = "Config.Enrolment.Show"; /// Show Enrolment Status /// Can show the enrolment status /// public const string ShowStatus = "Config.Enrolment.ShowStatus"; } /// Device Batch /// Permissions related to Device Batches /// public static class DeviceBatch { /// Configure Device Batches /// Can configure device batches /// public const string Configure = "Config.DeviceBatch.Configure"; /// Create Device Batches /// Can create device batches /// public const string Create = "Config.DeviceBatch.Create"; /// Delete Device Batches /// Can delete device batches /// public const string Delete = "Config.DeviceBatch.Delete"; /// Show Device Batches /// Can show device batches /// public const string Show = "Config.DeviceBatch.Show"; /// Show Timeline /// Can show device batch timeline /// public const string ShowTimeline = "Config.DeviceBatch.ShowTimeline"; } /// Device Model /// Permissions related to Device Models /// public static class DeviceModel { /// Configure Device Model Components /// Can configure device model components /// public const string ConfigureComponents = "Config.DeviceModel.ConfigureComponents"; /// Configure Device Models /// Can configure device models /// public const string Configure = "Config.DeviceModel.Configure"; /// Delete Device Models /// Can delete device models /// public const string Delete = "Config.DeviceModel.Delete"; /// Show Device Models /// Can show device models /// public const string Show = "Config.DeviceModel.Show"; } /// Device Profile /// Permissions related to Device Profiles /// public static class DeviceProfile { /// Configure Computer Name Templates /// Can configure computer name templates for device profiles /// public const string ConfigureComputerNameTemplate = "Config.DeviceProfile.ConfigureComputerNameTemplate"; /// Configure Default Device Profiles /// Can configure default device profiles /// public const string ConfigureDefaults = "Config.DeviceProfile.ConfigureDefaults"; /// Configure Device Profiles /// Can configure device profiles /// public const string Configure = "Config.DeviceProfile.Configure"; /// Create Device Profiles /// Can create device profiles /// public const string Create = "Config.DeviceProfile.Create"; /// Delete Device Profiles /// Can delete device profiles /// public const string Delete = "Config.DeviceProfile.Delete"; /// Show Device Profiles /// Can show device profiles /// public const string Show = "Config.DeviceProfile.Show"; } /// Document Template /// Permissions related to Document Templates /// public static class DocumentTemplate { /// Bulk Generate Document Templates /// Can bulk generate document templates /// public const string BulkGenerate = "Config.DocumentTemplate.BulkGenerate"; /// Configure Document Templates /// Can configure document templates /// public const string Configure = "Config.DocumentTemplate.Configure"; /// Configure Filter Expression /// Can configure filter expressions for document templates /// public const string ConfigureFilterExpression = "Config.DocumentTemplate.ConfigureFilterExpression"; /// Create Document Templates /// Can create document templates /// public const string Create = "Config.DocumentTemplate.Create"; /// Delete Document Templates /// Can delete document templates /// public const string Delete = "Config.DocumentTemplate.Delete"; /// Show Document Template Import Status /// Can show the document template import status /// public const string ShowStatus = "Config.DocumentTemplate.ShowStatus"; /// Show Document Templates /// Can show document templates /// public const string Show = "Config.DocumentTemplate.Show"; /// Undetected Pages /// Can show and assign imported documents which were not undetected /// public const string UndetectedPages = "Config.DocumentTemplate.UndetectedPages"; /// Upload Document Templates /// Can upload document templates /// public const string Upload = "Config.DocumentTemplate.Upload"; } /// Logging /// Permissions related to Logging /// public static class Logging { /// Show Logging /// Can show logging /// public const string Show = "Config.Logging.Show"; } /// Plugin /// Permissions related to Plugins /// public static class Plugin { /// Configure Plugins /// Can configure plugins /// public const string Configure = "Config.Plugin.Configure"; /// Install/Update Local Plugins /// Can install and update locally uploaded plugins /// public const string InstallLocal = "Config.Plugin.InstallLocal"; /// Install/Update Plugins /// Can install and update plugins /// public const string Install = "Config.Plugin.Install"; /// Show Plugins /// Can show plugins /// public const string Show = "Config.Plugin.Show"; /// Uninstall Plugins /// Can uninstall plugins /// public const string Uninstall = "Config.Plugin.Uninstall"; } /// System /// Permissions related to System Configuration /// public static class System { /// Configure Proxy Settings /// Can configure the proxy settings /// public const string ConfigureProxy = "Config.System.ConfigureProxy"; /// Show System Configuration /// Can show the system configuration /// public const string Show = "Config.System.Show"; } /// Organisation Details /// Permissions related to the Organisation Details /// public static class Organisation { /// Configure Addresses /// Can configure organisation addresses /// public const string ConfigureAddresses = "Config.Organisation.ConfigureAddresses"; /// Configure Logo /// Can configure the organisation logo /// public const string ConfigureLogo = "Config.Organisation.ConfigureLogo"; /// Configure Multi-Site Mode /// Can configure multi-site mode /// public const string ConfigureMultiSiteMode = "Config.Organisation.ConfigureMultiSiteMode"; /// Configure Name /// Can configure the organisation name /// public const string ConfigureName = "Config.Organisation.ConfigureName"; /// Show Organisation Details /// Can show the organisation details /// public const string Show = "Config.Organisation.Show"; } /// Job Preferences /// Permissions related to Job Preferences /// public static class JobPreferences { /// Configure Job Preferences /// Can configure job preferences /// public const string Configure = "Config.JobPreferences.Configure"; /// Show Job Preferences /// Can show job preferences /// public const string Show = "Config.JobPreferences.Show"; } /// Show Configuration /// Can show the configuration menu /// public const string Show = "Config.Show"; } /// Job /// Permissions related to Jobs /// public static class Job { /// Lists /// Permissions related to Job Lists /// public static class Lists { /// All Open List /// Can show list /// public const string AllOpen = "Job.Lists.AllOpen"; /// Awaiting Finance Agreement Breach List /// Can show list (NOTE: Requires Awaiting Finance List) /// public const string AwaitingFinanceAgreementBreach = "Job.Lists.AwaitingFinanceAgreementBreach"; /// Awaiting Finance Charge List /// Can show list (NOTE: Requires Awaiting Finance List) /// public const string AwaitingFinanceCharge = "Job.Lists.AwaitingFinanceCharge"; /// Awaiting Finance Insurance Processing List /// Can show list (NOTE: Requires Awaiting Finance List) /// public const string AwaitingFinanceInsuranceProcessing = "Job.Lists.AwaitingFinanceInsuranceProcessing"; /// Awaiting Finance List /// Can show list /// public const string AwaitingFinance = "Job.Lists.AwaitingFinance"; /// Awaiting Finance Payment List /// Can show list (NOTE: Requires Awaiting Finance List) /// public const string AwaitingFinancePayment = "Job.Lists.AwaitingFinancePayment"; /// Awaiting Technician Action List /// Can show list /// public const string AwaitingTechnicianAction = "Job.Lists.AwaitingTechnicianAction"; /// Awaiting User Action List /// Can show list /// public const string AwaitingUserAction = "Job.Lists.AwaitingUserAction"; /// Devices Awaiting Repair List /// Can show list /// public const string DevicesAwaitingRepair = "Job.Lists.DevicesAwaitingRepair"; /// Devices Ready For Return List /// Can show list /// public const string DevicesReadyForReturn = "Job.Lists.DevicesReadyForReturn"; /// Locations List /// Can show list /// public const string Locations = "Job.Lists.Locations"; /// Long Running Jobs List /// Can show list /// public const string LongRunningJobs = "Job.Lists.LongRunningJobs"; /// Recently Closed List /// Can show list /// public const string RecentlyClosed = "Job.Lists.RecentlyClosed"; } /// Actions /// Permissions related to Job Actions /// public static class Actions { /// Add Attachments /// Can add attachments to jobs /// public const string AddAttachments = "Job.Actions.AddAttachments"; /// Add Logs /// Can add job logs /// public const string AddLogs = "Job.Actions.AddLogs"; /// Close Jobs /// Can close jobs /// public const string Close = "Job.Actions.Close"; /// Convert HWar Jobs To HNWar /// Can convert warranty jobs to non-warranty jobs /// public const string ConvertHWarToHNWar = "Job.Actions.ConvertHWarToHNWar"; /// Create Jobs /// Can create jobs /// public const string Create = "Job.Actions.Create"; /// Delete Jobs /// Can delete jobs /// public const string Delete = "Job.Actions.Delete"; /// Force Close Jobs /// Can force close jobs /// public const string ForceClose = "Job.Actions.ForceClose"; /// Generate Documents /// Can generate documents for jobs /// public const string GenerateDocuments = "Job.Actions.GenerateDocuments"; /// Log Repair /// Can log repair for non-warranty jobs /// public const string LogRepair = "Job.Actions.LogRepair"; /// Log Warranty /// Can log warranty for jobs /// public const string LogWarranty = "Job.Actions.LogWarranty"; /// Remove Any Attachments /// Can remove any attachments from jobs /// public const string RemoveAnyAttachments = "Job.Actions.RemoveAnyAttachments"; /// Remove Any Logs /// Can remove any job logs /// public const string RemoveAnyLogs = "Job.Actions.RemoveAnyLogs"; /// Remove Own Attachments /// Can remove own attachments from jobs /// public const string RemoveOwnAttachments = "Job.Actions.RemoveOwnAttachments"; /// Remove Own Logs /// Can remove own job logs /// public const string RemoveOwnLogs = "Job.Actions.RemoveOwnLogs"; /// Reopen Jobs /// Can reopen jobs /// public const string Reopen = "Job.Actions.Reopen"; /// Update Sub Types /// Can update sub types for jobs /// public const string UpdateSubTypes = "Job.Actions.UpdateSubTypes"; } /// Job Properties /// Permissions related to Job Properties /// public static class Properties { /// Warranty Properties /// Permissions related to Warranty Job Properties /// public static class WarrantyProperties { /// External Completed Date Property /// Can update property /// public const string ExternalCompletedDate = "Job.Properties.WarrantyProperties.ExternalCompletedDate"; /// External Logged Date Property /// Can update property /// public const string ExternalLoggedDate = "Job.Properties.WarrantyProperties.ExternalLoggedDate"; /// External Name Property /// Can update property /// public const string ExternalName = "Job.Properties.WarrantyProperties.ExternalName"; /// External Reference Property /// Can update property /// public const string ExternalReference = "Job.Properties.WarrantyProperties.ExternalReference"; /// Provider Details /// Can access warranty provider details /// public const string ProviderDetails = "Job.Properties.WarrantyProperties.ProviderDetails"; /// Warranty Completed Property /// Can update property /// public const string WarrantyCompleted = "Job.Properties.WarrantyProperties.WarrantyCompleted"; } /// Non Warranty Properties /// Permissions related to Non-Warranty Job Properties /// public static class NonWarrantyProperties { /// Accounting Charge Added Property /// Can update property /// public const string AccountingChargeAdded = "Job.Properties.NonWarrantyProperties.AccountingChargeAdded"; /// Accounting Charge Paid Property /// Can update property /// public const string AccountingChargePaid = "Job.Properties.NonWarrantyProperties.AccountingChargePaid"; /// Accounting Charge Required Property /// Can update property /// public const string AccountingChargeRequired = "Job.Properties.NonWarrantyProperties.AccountingChargeRequired"; /// Add Components /// Can add job components (NOTE: Requires Edit Components) /// public const string AddComponents = "Job.Properties.NonWarrantyProperties.AddComponents"; /// Edit Components /// Can edit and remove job components /// public const string EditComponents = "Job.Properties.NonWarrantyProperties.EditComponents"; /// Insurance Claim Form Sent Property /// Can update property /// public const string InsuranceClaimFormSent = "Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent"; /// Insurance Detail Properties /// Can update insurance detail properties /// public const string InsuranceDetails = "Job.Properties.NonWarrantyProperties.InsuranceDetails"; /// Invoice Received Property /// Can update property /// public const string InvoiceReceived = "Job.Properties.NonWarrantyProperties.InvoiceReceived"; /// Is Insurance Claim Property /// Can update property /// public const string IsInsuranceClaim = "Job.Properties.NonWarrantyProperties.IsInsuranceClaim"; /// Purchase Order Raised Property /// Can update property /// public const string PurchaseOrderRaised = "Job.Properties.NonWarrantyProperties.PurchaseOrderRaised"; /// Purchase Order Reference Property /// Can update property /// public const string PurchaseOrderReference = "Job.Properties.NonWarrantyProperties.PurchaseOrderReference"; /// Purchase Order Sent Property /// Can update property /// public const string PurchaseOrderSent = "Job.Properties.NonWarrantyProperties.PurchaseOrderSent"; /// Repairer Completed Date Property /// Can update property /// public const string RepairerCompletedDate = "Job.Properties.NonWarrantyProperties.RepairerCompletedDate"; /// Repairer Logged Date Property /// Can update property /// public const string RepairerLoggedDate = "Job.Properties.NonWarrantyProperties.RepairerLoggedDate"; /// Repairer Name Property /// Can update property /// public const string RepairerName = "Job.Properties.NonWarrantyProperties.RepairerName"; /// Repairer Reference Property /// Can update property /// public const string RepairerReference = "Job.Properties.NonWarrantyProperties.RepairerReference"; } /// Device Held Location Property /// Can update property /// public const string DeviceHeldLocation = "Job.Properties.DeviceHeldLocation"; /// Device Held Property /// Can update property /// public const string DeviceHeld = "Job.Properties.DeviceHeld"; /// Device Ready For Return Property /// Can update property /// public const string DeviceReadyForReturn = "Job.Properties.DeviceReadyForReturn"; /// Device Returned Property /// Can update property /// public const string DeviceReturned = "Job.Properties.DeviceReturned"; /// Expected Closed Date Property /// Can update property /// public const string ExpectedClosedDate = "Job.Properties.ExpectedClosedDate"; /// Flags Property /// Can update property /// public const string Flags = "Job.Properties.Flags"; /// Not Waiting For User Action Property /// Can update property /// public const string NotWaitingForUserAction = "Job.Properties.NotWaitingForUserAction"; /// Waiting For User Action Property /// Can update property /// public const string WaitingForUserAction = "Job.Properties.WaitingForUserAction"; } /// Types /// Permissions related to Job Types /// public static class Types { /// Show Hardware - Miscellaneous Jobs /// Can show jobs of this type /// public const string ShowHMisc = "Job.Types.ShowHMisc"; /// Show Hardware - Non-Warranty Jobs /// Can show jobs of this type /// public const string ShowHNWar = "Job.Types.ShowHNWar"; /// Show Hardware - Warranty Jobs /// Can show jobs of this type /// public const string ShowHWar = "Job.Types.ShowHWar"; /// Show Software - Application Jobs /// Can show jobs of this type /// public const string ShowSApp = "Job.Types.ShowSApp"; /// Show Software - Operating System Jobs /// Can show jobs of this type /// public const string ShowSOS = "Job.Types.ShowSOS"; /// Show Software - Reimage Jobs /// Can show jobs of this type /// public const string ShowSImg = "Job.Types.ShowSImg"; /// Show User Management Jobs /// Can show jobs of this type /// public const string ShowUMgmt = "Job.Types.ShowUMgmt"; } /// Search Jobs /// Can search jobs /// public const string Search = "Job.Search"; /// Show Attachments /// Can show job attachments /// public const string ShowAttachments = "Job.ShowAttachments"; /// Show Daily Opened & Closed /// Can show daily opened & closed chart /// public const string ShowDailyChart = "Job.ShowDailyChart"; /// Show Flags /// Can show job flags /// public const string ShowFlags = "Job.ShowFlags"; /// Show Jobs /// Can show jobs /// public const string Show = "Job.Show"; /// Show Logs /// Can show job logs /// public const string ShowLogs = "Job.ShowLogs"; /// Show Non-Warranty Components /// Can show non-warranty job components /// public const string ShowNonWarrantyComponents = "Job.ShowNonWarrantyComponents"; /// Show Non-Warranty Finance /// Can show non-warranty job finance /// public const string ShowNonWarrantyFinance = "Job.ShowNonWarrantyFinance"; /// Show Non-Warranty Insurance /// Can show non-warranty job insurance /// public const string ShowNonWarrantyInsurance = "Job.ShowNonWarrantyInsurance"; /// Show Non-Warranty Repairs /// Can show non-warranty job repairs /// public const string ShowNonWarrantyRepairs = "Job.ShowNonWarrantyRepairs"; /// Show Warranty /// Can show job warranty /// public const string ShowWarranty = "Job.ShowWarranty"; } /// Device /// Permissions related to Devices /// public static class Device { /// Device Properties /// Permissions related to Device Properties /// public static class Properties { /// Asset Number Property /// Can update property /// public const string AssetNumber = "Device.Properties.AssetNumber"; /// Detail Properties /// Can update detail properties /// public const string Details = "Device.Properties.Details"; /// Device Batch Property /// Can update property /// public const string DeviceBatch = "Device.Properties.DeviceBatch"; /// Device Profile Property /// Can update property /// public const string DeviceProfile = "Device.Properties.DeviceProfile"; /// Location Property /// Can update property /// public const string Location = "Device.Properties.Location"; } /// Actions /// Permissions related to Device Actions /// public static class Actions { /// Add Attachments /// Can add attachments to devices /// public const string AddAttachments = "Device.Actions.AddAttachments"; /// Allow Unauthenticated Enrol /// Can allow devices to enrol without authentication /// public const string AllowUnauthenticatedEnrol = "Device.Actions.AllowUnauthenticatedEnrol"; /// Assign User /// Can update the user assignment of devices /// public const string AssignUser = "Device.Actions.AssignUser"; /// Decommission /// Can decommission devices /// public const string Decommission = "Device.Actions.Decommission"; /// Delete /// Can delete devices /// public const string Delete = "Device.Actions.Delete"; /// Enrol Devices /// Can add devices offline and enrol devices with the Bootstrapper /// public const string EnrolDevices = "Device.Actions.EnrolDevices"; /// Export Devices /// Can export devices in a bulk format /// public const string Export = "Device.Actions.Export"; /// Generate Documents /// Can generate documents for jobs /// public const string GenerateDocuments = "Device.Actions.GenerateDocuments"; /// Import Devices /// Can bulk import devices /// public const string Import = "Device.Actions.Import"; /// Recommission /// Can recommission devices /// public const string Recommission = "Device.Actions.Recommission"; /// Remove Any Attachments /// Can remove any attachments from devices /// public const string RemoveAnyAttachments = "Device.Actions.RemoveAnyAttachments"; /// Remove Own Attachments /// Can remove own attachments from devices /// public const string RemoveOwnAttachments = "Device.Actions.RemoveOwnAttachments"; } /// Search Devices /// Can search devices /// public const string Search = "Device.Search"; /// Show Assignment History /// Can show the assignment history for devices /// public const string ShowAssignmentHistory = "Device.ShowAssignmentHistory"; /// Show Attachments /// Can show device attachments /// public const string ShowAttachments = "Device.ShowAttachments"; /// Show Certificates /// Can show certificates associated with devices /// public const string ShowCertificates = "Device.ShowCertificates"; /// Show Details /// Can show details associated with devices /// public const string ShowDetails = "Device.ShowDetails"; /// Show Devices /// Can show devices /// public const string Show = "Device.Show"; /// Show Devices Jobs /// Can show jobs associated with devices /// public const string ShowJobs = "Device.ShowJobs"; } /// User /// Permissions related to Users /// public static class User { /// Actions /// Permissions related to User Actions /// public static class Actions { /// Add Attachments /// Can add attachments to users /// public const string AddAttachments = "User.Actions.AddAttachments"; /// Generate Documents /// Can generate documents for users /// public const string GenerateDocuments = "User.Actions.GenerateDocuments"; /// Remove Any Attachments /// Can remove any attachments from users /// public const string RemoveAnyAttachments = "User.Actions.RemoveAnyAttachments"; /// Remove Own Attachments /// Can remove own attachments from users /// public const string RemoveOwnAttachments = "User.Actions.RemoveOwnAttachments"; } /// Search Users /// Can search users /// public const string Search = "User.Search"; /// Show Attachments /// Can show user attachments /// public const string ShowAttachments = "User.ShowAttachments"; /// Show Device Assignment History /// Can show the device assignment history for users /// public const string ShowAssignmentHistory = "User.ShowAssignmentHistory"; /// Show Users /// Can show users /// public const string Show = "User.Show"; /// Show Users Authorization /// Can show authorization permissions associated with users /// public const string ShowAuthorization = "User.ShowAuthorization"; /// Show Users Jobs /// Can show jobs associated with users /// public const string ShowJobs = "User.ShowJobs"; } /// Computer Account /// Represents a computer account /// public const string ComputerAccount = "ComputerAccount"; /// Disco Administrator Account /// Represents a Disco Administrator account /// public const string DiscoAdminAccount = "DiscoAdminAccount"; #endregion } public static class ClaimExtensions { public static bool Has(this RoleClaims c, string ClaimKey) { Func claimFunc = Claims.GetClaimAccessor(ClaimKey); return claimFunc(c); } public static void Set(this RoleClaims c, string ClaimKey, bool Value) { var claimDefinition = Claims.GetClaimDefinition(ClaimKey); if (!claimDefinition.Item5) claimDefinition.Item2(c, Value); } public static void SetClaims(this AuthorizationRole role, RoleClaims Claims) { role.ClaimsJson = Newtonsoft.Json.JsonConvert.SerializeObject(Claims); } } }