private RoleEntry ParseListElementToRoleEntry(XmlTextReader reader) { RoleEntry result = null; try { result = RoleEntry.Parse(reader.Value); } catch (FormatException ex) { this.ThrowParserException(reader, new LocalizedString(ex.Message)); } return(result); }
public List <RoleEntry> GetRoleEntriesFilteringProhibitedActions(List <string> features, List <string> prohibitedActions) { if (!this.ContainsProhibitedActions(prohibitedActions)) { throw new InvalidOperationException(string.Format(" Role '{0}' doesn't have any prohibited action.", this.RoleName)); } string input = null; List <RoleEntry> list = new List <RoleEntry>(this.cmdlets.Length); foreach (RoleCmdlet roleCmdlet in this.cmdlets) { if (roleCmdlet.TryGenerateRoleEntryFilteringProhibitedActions(features, prohibitedActions, ref input)) { list.Add(RoleEntry.Parse(input)); } } return(list); }
public ExchangeRole GenerateRole(List <string> enabledFeatures, ADObjectId rolesContainerId, string suffix, string resolutionType) { ExchangeRole exchangeRole = new ExchangeRole(); string input = null; exchangeRole.SetId(rolesContainerId.GetChildId(this.RoleName + suffix)); exchangeRole.RoleType = this.roleType; exchangeRole.MailboxPlanIndex = resolutionType; exchangeRole.StampImplicitScopes(); exchangeRole.StampIsEndUserRole(); foreach (RoleCmdlet roleCmdlet in this.cmdlets) { if (roleCmdlet.TryGenerateRoleEntry(enabledFeatures, ref input)) { exchangeRole.RoleEntries.Add(RoleEntry.Parse(input)); } } return(exchangeRole); }