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:
@@ -66,14 +66,10 @@ namespace Disco.BI.DocumentTemplateBI
|
||||
}
|
||||
public DocumentUniqueIdentifier(string TemplateTypeId, string DataId, string CreatorId, DateTime TimeStamp, int? Page = null, string Tag = null)
|
||||
{
|
||||
var creatorId = (string.IsNullOrEmpty(CreatorId) || CreatorId.IndexOf('\\') > -1)
|
||||
? CreatorId
|
||||
: string.Format(@"{0}\{1}", ActiveDirectory.Context.PrimaryDomain.NetBiosName, CreatorId);
|
||||
|
||||
this.Tag = Tag;
|
||||
this.TemplateTypeId = TemplateTypeId;
|
||||
this.DataId = DataId;
|
||||
this.CreatorId = creatorId;
|
||||
this.CreatorId = ActiveDirectory.ParseDomainAccountId(CreatorId);
|
||||
this.TimeStamp = TimeStamp;
|
||||
this.Page = Page ?? 0;
|
||||
}
|
||||
@@ -98,11 +94,7 @@ namespace Disco.BI.DocumentTemplateBI
|
||||
}
|
||||
if (s.Length >= 5)
|
||||
{
|
||||
var creatorId = s[4];
|
||||
if (!string.IsNullOrWhiteSpace(creatorId) && creatorId.IndexOf('\\') < 0)
|
||||
creatorId = string.Format(@"{0}\{1}", ActiveDirectory.Context.PrimaryDomain.NetBiosName, creatorId);
|
||||
|
||||
this.CreatorId = creatorId;
|
||||
this.CreatorId = ActiveDirectory.ParseDomainAccountId(s[4]);
|
||||
}
|
||||
if (s.Length >= 6)
|
||||
{
|
||||
@@ -189,13 +181,7 @@ namespace Disco.BI.DocumentTemplateBI
|
||||
}
|
||||
break;
|
||||
case DocumentTemplate.DocumentTemplateScopes.User:
|
||||
|
||||
// Patch for existing documents (before DBv13 - Multi-Domain Support)
|
||||
// Add default domain to User Ids
|
||||
if (this.DataId.IndexOf('\\') < 0)
|
||||
this.DataId = string.Format(@"{0}\{1}", ActiveDirectory.Context.PrimaryDomain.NetBiosName, this.DataId);
|
||||
|
||||
User u = Database.Users.Find(this.DataId);
|
||||
User u = Database.Users.Find(ActiveDirectory.ParseDomainAccountId(this.DataId));
|
||||
if (u != null)
|
||||
{
|
||||
this._data = u;
|
||||
|
||||
Reference in New Issue
Block a user