Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }