public override ApplicationGroup GetGroup(string uniqueName) { AdApplicationGroup ag = new AdApplicationGroup(); ag.Load(Load(uniqueName)); ag.IsGlobalGroup = ag.ContainerDn.Substring(ag.ContainerDn.IndexOf(",") + 1).Equals(_BaseDN, StringComparison.InvariantCultureIgnoreCase); return(new ApplicationGroup(ag)); }
public override IEnumerator <Member> GetMembers(string uniqueName, bool isExclusions) { SearchResultEntry result = Load(uniqueName); foreach (var item in AdApplicationGroup.GetMembers(result, isExclusions)) { AdMember a = new AdMember(); yield return(new Member(a)); } }
public ApplicationGroup CreateGroup(string parent, string name, string description, GroupType groupType, bool isGlobalGroup) { AdApplicationGroup ag = new AdApplicationGroup(); ag.Name = name; ag.Description = description; ag.GroupType = groupType; ag.ContainerDn = string.Format("cn={0}{1},{2}", GROUPSCONTAINER, parent.Substring(3, parent.IndexOf(",") - 3), parent); ag.IsGlobalGroup = isGlobalGroup; ag.Groups = new Collections.ApplicationGroupCollection(true); _Service.Save(ag.CreateNew()); return(new ApplicationGroup(ag)); }
public AdAdminManager() : base() { ChangeTrackingDisabled = true; SearchResultEntry en = Service.LoadRoot(); Load(en); MajorVersion = int.Parse(GetAttribute(en.Attributes, MAJORVERSION)); MinorVersion = int.Parse(GetAttribute(en.Attributes, MINORVERSION)); Groups = AdApplicationGroup.GetCollection(GetGroupContainerName(), false); Applications = AdApplication.GetCollection(Key); ChangeTrackingDisabled = false; }
public override void Load(SearchResultEntry entry) { ChangeTrackingDisabled = true; base.Load(entry); CN = GetAttribute(entry.Attributes, "name"); ApplicationVersion = GetAttribute(entry.Attributes, VERSION); ContainerDn = Key.Substring(4 + CN.Length); Groups = AdApplicationGroup.GetCollection(string.Format("cn={0}{2},{1}", GROUPSCONTAINER, Key, CN), false); Roles = AdRoleDefinition.GetRoles(string.Format("cn={0}{2},{1}", TASKSCONTAINER, Key, CN), false); RoleAssignments = new Collections.RoleAssignmentsCollection(); Tasks = AdTask.GetTasks(string.Format("cn={0}{2},{1}", TASKSCONTAINER, Key, CN), false); Operations = AdOperation.GetCollection(string.Format("cn={0}{1},{2}", OPSCONTAINER, CN, Key), false); ChangeTrackingDisabled = false; }
public override IEnumerator <ApplicationGroup> GetGroups(IEnumerable <string> uniqueNames, AdminManager store, Application application) { using (LdapConnection conn = GetConnection()) { foreach (var item in uniqueNames) { AdApplicationGroup g = new AdApplicationGroup(); g.Load(Load(item, conn)); g.IsGlobalGroup = g.ContainerDn.Substring(g.ContainerDn.IndexOf(",") + 1).Equals(_BaseDN, StringComparison.InvariantCultureIgnoreCase); ApplicationGroup result = new ApplicationGroup(g); if (result.IsGlobalGroup) { result.Store = store; } else { result.Parent = application; } yield return(result); } } }
public void UpdateGroup(Interfaces.IApplicationGroup group) { AdApplicationGroup ag = (AdApplicationGroup)group; _Service.Save(ag.GetUpdate()); }