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:
@@ -63,12 +63,12 @@ namespace Disco.Services
|
||||
i.UserId = j.UserId;
|
||||
i.UserDisplayName = j.User.DisplayName;
|
||||
|
||||
i.UserFriendlyId = UserExtensions.FriendlyUserId(j.UserId);
|
||||
i.UserFriendlyId = ActiveDirectory.FriendlyAccountId(j.UserId);
|
||||
}
|
||||
if (j.OpenedTechUser != null)
|
||||
{
|
||||
i.OpenedTechUserId = j.OpenedTechUserId;
|
||||
i.OpenedTechUserFriendlyId = UserExtensions.FriendlyUserId(j.OpenedTechUserId);
|
||||
i.OpenedTechUserFriendlyId = ActiveDirectory.FriendlyAccountId(j.OpenedTechUserId);
|
||||
i.OpenedTechUserDisplayName = j.OpenedTechUser.DisplayName;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
using Disco.Services.Users;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -233,8 +234,8 @@ namespace Disco.Services
|
||||
|
||||
foreach (var j in items)
|
||||
{
|
||||
j.UserFriendlyId =j.UserId == null ? null : UserExtensions.FriendlyUserId(j.UserId);
|
||||
j.OpenedTechUserFriendlyId = UserExtensions.FriendlyUserId(j.OpenedTechUserId);
|
||||
j.UserFriendlyId =j.UserId == null ? null : ActiveDirectory.FriendlyAccountId(j.UserId);
|
||||
j.OpenedTechUserFriendlyId = ActiveDirectory.FriendlyAccountId(j.OpenedTechUserId);
|
||||
|
||||
if (j.DeviceAddressId.HasValue)
|
||||
j.DeviceAddress = Database.DiscoConfiguration.OrganisationAddresses.GetAddress(j.DeviceAddressId.Value).Name;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Disco.Data.Configuration.Modules;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Services.Jobs.Noticeboards;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -17,7 +18,7 @@ namespace Disco.Services.Jobs.Noticeboards
|
||||
{
|
||||
get
|
||||
{
|
||||
return DeviceComputerName == null ? null : UserExtensions.FriendlyUserId(DeviceComputerName);
|
||||
return DeviceComputerName == null ? null : ActiveDirectory.FriendlyAccountId(DeviceComputerName);
|
||||
}
|
||||
set { } // for XML Serialization
|
||||
}
|
||||
@@ -67,7 +68,7 @@ namespace Disco.Services.Jobs.Noticeboards
|
||||
{
|
||||
get
|
||||
{
|
||||
return UserId == null ? null : UserExtensions.FriendlyUserId(UserId);
|
||||
return UserId == null ? null : ActiveDirectory.FriendlyAccountId(UserId);
|
||||
}
|
||||
set { } // for XML Serialization
|
||||
}
|
||||
|
||||
@@ -82,9 +82,7 @@ namespace Disco.Services.Jobs.Noticeboards
|
||||
}
|
||||
public static IHeldDeviceItem GetHeldDeviceForUsers(DiscoDataContext Database, string UserId)
|
||||
{
|
||||
var split = UserExtensions.SplitUserId(UserId);
|
||||
if (split.Item1 == null)
|
||||
UserId = string.Format(@"{0}\{1}", ActiveDirectory.Context.PrimaryDomain.NetBiosName, UserId);
|
||||
UserId = ActiveDirectory.ParseDomainAccountId(UserId);
|
||||
|
||||
return GetHeldDevicesForUsers(Database.Devices.Where(d => d.AssignedUserId == UserId).SelectMany(d => d.Jobs)).FirstOrDefault();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user