Permissions & Authorization for Users #24
Initial Release; Includes Database and MVC refactoring
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.DeviceBatch;
|
||||
using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.DeviceCertificate;
|
||||
using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.DeviceModel;
|
||||
using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.DeviceProfile;
|
||||
using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.DocumentTemplate;
|
||||
using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.Enrolment;
|
||||
using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.Logging;
|
||||
using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.Origanisation;
|
||||
using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.Plugin;
|
||||
using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Services.Authorization.Roles.ClaimGroups.Configuration
|
||||
{
|
||||
[ClaimDetails("Configuration", "Permissions related to Disco Configuration")]
|
||||
public class ConfigClaims : BaseRoleClaimGroup
|
||||
{
|
||||
public ConfigClaims()
|
||||
{
|
||||
this.DeviceCertificate = new DeviceCertificateClaims();
|
||||
this.Enrolment = new EnrolmentClaims();
|
||||
this.DeviceBatch = new DeviceBatchClaims();
|
||||
this.DeviceModel = new DeviceModelClaims();
|
||||
this.DeviceProfile = new DeviceProfileClaims();
|
||||
this.DocumentTemplate = new DocumentTemplateClaims();
|
||||
this.Logging = new LoggingClaims();
|
||||
this.Plugin = new PluginClaims();
|
||||
this.System = new SystemClaims();
|
||||
this.Organisation = new OrganisationClaims();
|
||||
}
|
||||
|
||||
[ClaimDetails("Show Configuration", "Can show the configuration menu")]
|
||||
public bool Show { get; set; }
|
||||
|
||||
public DeviceCertificateClaims DeviceCertificate { get; set; }
|
||||
|
||||
public EnrolmentClaims Enrolment { get; set; }
|
||||
|
||||
public DeviceBatchClaims DeviceBatch { get; set; }
|
||||
|
||||
public DeviceModelClaims DeviceModel { get; set; }
|
||||
|
||||
public DeviceProfileClaims DeviceProfile { get; set; }
|
||||
|
||||
public DocumentTemplateClaims DocumentTemplate { get; set; }
|
||||
|
||||
public LoggingClaims Logging { get; set; }
|
||||
|
||||
public PluginClaims Plugin { get; set; }
|
||||
|
||||
public SystemClaims System { get; set; }
|
||||
|
||||
public OrganisationClaims Organisation { get; set; }
|
||||
}
|
||||
}
|
||||
+27
@@ -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.Configuration.DeviceBatch
|
||||
{
|
||||
[ClaimDetails("Device Batch", "Permissions related to Device Batches")]
|
||||
public class DeviceBatchClaims : BaseRoleClaimGroup
|
||||
{
|
||||
[ClaimDetails("Configure Device Batches", "Can configure device batches")]
|
||||
public bool Configure { get; set; }
|
||||
|
||||
[ClaimDetails("Create Device Batches", "Can create device batches")]
|
||||
public bool Create { get; set; }
|
||||
|
||||
[ClaimDetails("Delete Device Batches", "Can delete device batches")]
|
||||
public bool Delete { get; set; }
|
||||
|
||||
[ClaimDetails("Show Device Batches", "Can show device batches")]
|
||||
public bool Show { get; set; }
|
||||
|
||||
[ClaimDetails("Show Timeline", "Can show device batch timeline")]
|
||||
public bool ShowTimeline { get; set; }
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Services.Authorization.Roles.ClaimGroups.Configuration.DeviceCertificate
|
||||
{
|
||||
[ClaimDetails("Device Certificate", "Permissions related to Device Certificates")]
|
||||
public class DeviceCertificateClaims : BaseRoleClaimGroup
|
||||
{
|
||||
[ClaimDetails("Download Certificates", "Can download certificates")]
|
||||
public bool DownloadCertificates { get; set; }
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Services.Authorization.Roles.ClaimGroups.Configuration.DeviceModel
|
||||
{
|
||||
[ClaimDetails("Device Model", "Permissions related to Device Models")]
|
||||
public class DeviceModelClaims : BaseRoleClaimGroup
|
||||
{
|
||||
[ClaimDetails("Configure Device Models", "Can configure device models")]
|
||||
public bool Configure { get; set; }
|
||||
|
||||
[ClaimDetails("Configure Device Model Components", "Can configure device model components")]
|
||||
public bool ConfigureComponents { get; set; }
|
||||
|
||||
[ClaimDetails("Delete Device Models", "Can delete device models")]
|
||||
public bool Delete { get; set; }
|
||||
|
||||
[ClaimDetails("Show Device Models", "Can show device models")]
|
||||
public bool Show { get; set; }
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Services.Authorization.Roles.ClaimGroups.Configuration.DeviceProfile
|
||||
{
|
||||
[ClaimDetails("Device Profile", "Permissions related to Device Profiles")]
|
||||
public class DeviceProfileClaims : BaseRoleClaimGroup
|
||||
{
|
||||
[ClaimDetails("Configure Device Profiles", "Can configure device profiles")]
|
||||
public bool Configure { get; set; }
|
||||
|
||||
[ClaimDetails("Configure Computer Name Templates", "Can configure computer name templates for device profiles")]
|
||||
public bool ConfigureComputerNameTemplate { get; set; }
|
||||
|
||||
[ClaimDetails("Configure Default Device Profiles", "Can configure default device profiles")]
|
||||
public bool ConfigureDefaults { get; set; }
|
||||
|
||||
[ClaimDetails("Create Device Profiles", "Can create device profiles")]
|
||||
public bool Create { get; set; }
|
||||
|
||||
[ClaimDetails("Delete Device Profiles", "Can delete device profiles")]
|
||||
public bool Delete { get; set; }
|
||||
|
||||
[ClaimDetails("Show Device Profiles", "Can show device profiles")]
|
||||
public bool Show { get; set; }
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Services.Authorization.Roles.ClaimGroups.Configuration.DocumentTemplate
|
||||
{
|
||||
[ClaimDetails("Document Template", "Permissions related to Document Templates")]
|
||||
public class DocumentTemplateClaims : BaseRoleClaimGroup
|
||||
{
|
||||
[ClaimDetails("Configure Document Templates", "Can configure document templates")]
|
||||
public bool Configure { get; set; }
|
||||
|
||||
[ClaimDetails("Configure Filter Expression", "Can configure filter expressions for document templates")]
|
||||
public bool ConfigureFilterExpression { get; set; }
|
||||
|
||||
[ClaimDetails("Upload Document Templates", "Can upload document templates")]
|
||||
public bool Upload { get; set; }
|
||||
|
||||
[ClaimDetails("Create Document Templates", "Can create document templates")]
|
||||
public bool Create { get; set; }
|
||||
|
||||
[ClaimDetails("Delete Document Templates", "Can delete document templates")]
|
||||
public bool Delete { get; set; }
|
||||
|
||||
[ClaimDetails("Show Document Templates", "Can show document templates")]
|
||||
public bool Show { get; set; }
|
||||
|
||||
[ClaimDetails("Show Document Template Import Status", "Can show the document template import status")]
|
||||
public bool ShowStatus { get; set; }
|
||||
|
||||
[ClaimDetails("Bulk Generate Document Templates", "Can bulk generate document templates")]
|
||||
public bool BulkGenerate { get; set; }
|
||||
|
||||
[ClaimDetails("Undetected Pages", "Can show and assign imported documents which were not undetected")]
|
||||
public bool UndetectedPages { get; set; }
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Services.Authorization.Roles.ClaimGroups.Configuration.Enrolment
|
||||
{
|
||||
[ClaimDetails("Enrolment", "Permissions related to Device Enrolment")]
|
||||
public class EnrolmentClaims
|
||||
{
|
||||
[ClaimDetails("Show Enrolment", "Can show device enrolment")]
|
||||
public bool Show { get; set; }
|
||||
|
||||
[ClaimDetails("Configure Enrolment", "Can configure device enrolment")]
|
||||
public bool Configure { get; set; }
|
||||
|
||||
[ClaimDetails("Show Enrolment Status", "Can show the enrolment status")]
|
||||
public bool ShowStatus { get; set; }
|
||||
|
||||
[ClaimDetails("Download Bootstrapper", "Can download the Device Bootstrapper")]
|
||||
public bool DownloadBootstrapper { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Services.Authorization.Roles.ClaimGroups.Configuration.Logging
|
||||
{
|
||||
[ClaimDetails("Logging", "Permissions related to Logging")]
|
||||
public class LoggingClaims : BaseRoleClaimGroup
|
||||
{
|
||||
[ClaimDetails("Show Logging", "Can show logging")]
|
||||
public bool Show { get; set; }
|
||||
}
|
||||
}
|
||||
+27
@@ -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.Configuration.Origanisation
|
||||
{
|
||||
[ClaimDetails("Organisation Details", "Permissions related to the Organisation Details")]
|
||||
public class OrganisationClaims : BaseRoleClaimGroup
|
||||
{
|
||||
[ClaimDetails("Show Organisation Details", "Can show the organisation details")]
|
||||
public bool Show { get; set; }
|
||||
|
||||
[ClaimDetails("Configure Name", "Can configure the organisation name")]
|
||||
public bool ConfigureName { get; set; }
|
||||
|
||||
[ClaimDetails("Configure Logo", "Can configure the organisation logo")]
|
||||
public bool ConfigureLogo { get; set; }
|
||||
|
||||
[ClaimDetails("Configure Multi-Site Mode", "Can configure multi-site mode")]
|
||||
public bool ConfigureMultiSiteMode { get; set; }
|
||||
|
||||
[ClaimDetails("Configure Addresses", "Can configure organisation addresses")]
|
||||
public bool ConfigureAddresses { 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.Configuration.Plugin
|
||||
{
|
||||
[ClaimDetails("Plugin", "Permissions related to Plugins")]
|
||||
public class PluginClaims : BaseRoleClaimGroup
|
||||
{
|
||||
[ClaimDetails("Show Plugins", "Can show plugins")]
|
||||
public bool Show { get; set; }
|
||||
|
||||
[ClaimDetails("Install/Update Plugins", "Can install and update plugins")]
|
||||
public bool Install { get; set; }
|
||||
|
||||
[ClaimDetails("Install/Update Local Plugins", "Can install and update locally uploaded plugins")]
|
||||
public bool InstallLocal { get; set; }
|
||||
|
||||
[ClaimDetails("Uninstall Plugins", "Can uninstall plugins")]
|
||||
public bool Uninstall { get; set; }
|
||||
|
||||
[ClaimDetails("Configure Plugins", "Can configure plugins")]
|
||||
public bool Configure { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Services.Authorization.Roles.ClaimGroups.Configuration.System
|
||||
{
|
||||
[ClaimDetails("System", "Permissions related to System Configuration")]
|
||||
public class SystemClaims : BaseRoleClaimGroup
|
||||
{
|
||||
[ClaimDetails("Show System Configuration", "Can show the system configuration")]
|
||||
public bool Show { get; set; }
|
||||
|
||||
[ClaimDetails("Configure Proxy Settings", "Can configure the proxy settings")]
|
||||
public bool ConfigureProxy { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user