Permissions & Authorization for Users #24
Initial Release; Includes Database and MVC refactoring
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Services.Authorization.Roles.ClaimGroups.Device
|
||||
{
|
||||
[ClaimDetails("Actions", "Permissions related to Device Actions")]
|
||||
public class DeviceActionsClaims : BaseRoleClaimGroup
|
||||
{
|
||||
[ClaimDetails("Allow Unauthenticated Enrol", "Can allow devices to enrol without authentication")]
|
||||
public bool AllowUnauthenticatedEnrol { get; set; }
|
||||
|
||||
[ClaimDetails("Assign User", "Can update the user assignment of devices")]
|
||||
public bool AssignUser { get; set; }
|
||||
|
||||
[ClaimDetails("Decommission", "Can decommission devices")]
|
||||
public bool Decommission { get; set; }
|
||||
[ClaimDetails("Recommission", "Can recommission devices")]
|
||||
public bool Recommission { get; set; }
|
||||
[ClaimDetails("Delete", "Can delete devices")]
|
||||
public bool Delete { get; set; }
|
||||
|
||||
[ClaimDetails("Add Attachments", "Can add attachments to devices")]
|
||||
public bool AddAttachments { get; set; }
|
||||
[ClaimDetails("Remove Any Attachments", "Can remove any attachments from devices")]
|
||||
public bool RemoveAnyAttachments { get; set; }
|
||||
[ClaimDetails("Remove Own Attachments", "Can remove own attachments from devices")]
|
||||
public bool RemoveOwnAttachments { get; set; }
|
||||
|
||||
[ClaimDetails("Generate Documents", "Can generate documents for jobs")]
|
||||
public bool GenerateDocuments { get; set; }
|
||||
|
||||
[ClaimDetails("Enrol Devices", "Can add devices offline and enrol devices with the Bootstrapper")]
|
||||
public bool EnrolDevices { get; set; }
|
||||
[ClaimDetails("Import Devices", "Can bulk import devices")]
|
||||
public bool Import { get; set; }
|
||||
[ClaimDetails("Export Devices", "Can export devices in a bulk format")]
|
||||
public bool Export { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Services.Authorization.Roles.ClaimGroups.Device
|
||||
{
|
||||
[ClaimDetails("Device", "Permissions related to Devices")]
|
||||
public class DeviceClaims : BaseRoleClaimGroup
|
||||
{
|
||||
public DeviceClaims()
|
||||
{
|
||||
this.Properties = new DevicePropertiesClaims();
|
||||
this.Actions = new DeviceActionsClaims();
|
||||
}
|
||||
|
||||
[ClaimDetails("Search Devices", "Can search devices")]
|
||||
public bool Search { get; set; }
|
||||
|
||||
[ClaimDetails("Show Devices", "Can show devices")]
|
||||
public bool Show { get; set; }
|
||||
|
||||
[ClaimDetails("Show Details", "Can show details associated with devices")]
|
||||
public bool ShowDetails { get; set; }
|
||||
[ClaimDetails("Show Attachments", "Can show device attachments")]
|
||||
public bool ShowAttachments { get; set; }
|
||||
[ClaimDetails("Show Certificates", "Can show certificates associated with devices")]
|
||||
public bool ShowCertificates { get; set; }
|
||||
[ClaimDetails("Show Devices Jobs", "Can show jobs associated with devices")]
|
||||
public bool ShowJobs { get; set; }
|
||||
[ClaimDetails("Show Assignment History", "Can show the assignment history for devices")]
|
||||
public bool ShowAssignmentHistory { get; set; }
|
||||
|
||||
|
||||
public DevicePropertiesClaims Properties { get; set; }
|
||||
|
||||
public DeviceActionsClaims Actions { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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.Device
|
||||
{
|
||||
[ClaimDetails("Device Properties", "Permissions related to Device Properties")]
|
||||
public class DevicePropertiesClaims : BaseRoleClaimGroup
|
||||
{
|
||||
[ClaimDetails("Device Profile Property", "Can update property")]
|
||||
public bool DeviceProfile { get; set; }
|
||||
|
||||
[ClaimDetails("Device Batch Property", "Can update property")]
|
||||
public bool DeviceBatch { get; set; }
|
||||
|
||||
[ClaimDetails("Asset Number Property", "Can update property")]
|
||||
public bool AssetNumber { get; set; }
|
||||
|
||||
[ClaimDetails("Location Property", "Can update property")]
|
||||
public bool Location { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user