Feature #49: Active Directory Managed Groups
Document Template Attachments, Device Batches, Device Profiles and User Flags can be associated with an Active Directory group. This AD group is then automatically synchronized with relevant User/Machine accounts. Contains various other UI tweaks and configuration enhancements.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.UI.Config.DeviceBatch;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Devices.ManagedGroups;
|
||||
using Disco.Services.Plugins.Features.UIExtension;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
@@ -36,6 +37,13 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
DeviceDecommissionedCount = dG.Count(d => d.DecommissionedDate.HasValue)
|
||||
}).ToArray().Cast<ConfigDeviceBatchShowModelMembership>().ToList();
|
||||
|
||||
DeviceBatchAssignedUsersManagedGroup assignedUsersManagedGroup;
|
||||
if (DeviceBatchAssignedUsersManagedGroup.TryGetManagedGroup(m.DeviceBatch, out assignedUsersManagedGroup))
|
||||
m.AssignedUsersLinkedGroup = assignedUsersManagedGroup;
|
||||
DeviceBatchDevicesManagedGroup devicesManagedGroup;
|
||||
if (DeviceBatchDevicesManagedGroup.TryGetManagedGroup(m.DeviceBatch, out devicesManagedGroup))
|
||||
m.DevicesLinkedGroup = devicesManagedGroup;
|
||||
|
||||
if (Authorization.Has(Claims.Config.DeviceBatch.Delete))
|
||||
m.CanDelete = m.DeviceBatch.CanDelete(Database);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.UI.Config.DeviceProfile;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Devices.ManagedGroups;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
using Disco.Services.Plugins;
|
||||
using Disco.Services.Plugins.Features.CertificateProvider;
|
||||
@@ -36,6 +37,13 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
if (m.DeviceProfile.DefaultOrganisationAddress.HasValue)
|
||||
m.DefaultOrganisationAddress = Database.DiscoConfiguration.OrganisationAddresses.GetAddress(m.DeviceProfile.DefaultOrganisationAddress.Value);
|
||||
|
||||
DeviceProfileAssignedUsersManagedGroup assignedUsersManagedGroup;
|
||||
if (DeviceProfileAssignedUsersManagedGroup.TryGetManagedGroup(m.DeviceProfile, out assignedUsersManagedGroup))
|
||||
m.AssignedUsersLinkedGroup = assignedUsersManagedGroup;
|
||||
DeviceProfileDevicesManagedGroup devicesManagedGroup;
|
||||
if (DeviceProfileDevicesManagedGroup.TryGetManagedGroup(m.DeviceProfile, out devicesManagedGroup))
|
||||
m.DevicesLinkedGroup = devicesManagedGroup;
|
||||
|
||||
m.CertificateProviders = Plugins.GetPluginFeatures(typeof(CertificateProviderFeature));
|
||||
|
||||
var DistributionValues = Enum.GetValues(typeof(Disco.Models.Repository.DeviceProfile.DistributionTypes));
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.BI.DocumentTemplateBI.ManagedGroups;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.UI.Config.DocumentTemplate;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Plugins.Features.UIExtension;
|
||||
@@ -33,6 +34,13 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
m.TemplateExpressions = m.DocumentTemplate.ExtractPdfExpressions(Database);
|
||||
m.UpdateModel(Database);
|
||||
|
||||
DocumentTemplateDevicesManagedGroup devicesManagedGroup;
|
||||
if (DocumentTemplateDevicesManagedGroup.TryGetManagedGroup(m.DocumentTemplate, out devicesManagedGroup))
|
||||
m.DevicesLinkedGroup = devicesManagedGroup;
|
||||
DocumentTemplateUsersManagedGroup usersManagedGroup;
|
||||
if (DocumentTemplateUsersManagedGroup.TryGetManagedGroup(m.DocumentTemplate, out usersManagedGroup))
|
||||
m.UsersLinkedGroup = usersManagedGroup;
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<ConfigDocumentTemplateShowModel>(this.ControllerContext, m);
|
||||
|
||||
|
||||
@@ -30,6 +30,13 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
if (m == null)
|
||||
throw new ArgumentException("Invalid User Flag Id");
|
||||
|
||||
UserFlagUsersManagedGroup assignedUsersManagedGroup;
|
||||
if (UserFlagUsersManagedGroup.TryGetManagedGroup(m.UserFlag, out assignedUsersManagedGroup))
|
||||
m.UsersLinkedGroup = assignedUsersManagedGroup;
|
||||
UserFlagUserDevicesManagedGroup assignedUserDevicesManagedGroup;
|
||||
if (UserFlagUserDevicesManagedGroup.TryGetManagedGroup(m.UserFlag, out assignedUserDevicesManagedGroup))
|
||||
m.UserDevicesLinkedGroup = assignedUserDevicesManagedGroup;
|
||||
|
||||
if (Authorization.Has(Claims.Config.UserFlag.Configure))
|
||||
{
|
||||
m.Icons = UIHelpers.Icons;
|
||||
|
||||
Reference in New Issue
Block a user