Esempio n. 1
0
 public ExportTransportRuleCollection()
 {
     this.supportedPredicates = TransportRulePredicate.GetAvailablePredicateMappings();
     this.supportedActions    = TransportRuleAction.GetAvailableActionMappings();
     base.RuleCollectionName  = Utils.RuleCollectionNameFromRole();
     this.Format = RuleCollectionFormat.RuleCollectionXML;
 }
Esempio n. 2
0
        protected override void InternalProcessRecord()
        {
            bool enabled = VariantConfiguration.InvariantNoFlightingSnapshot.CompliancePolicy.ShowSupervisionPredicate.Enabled;
            IConfigDataProvider session = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromRootOrgScopeSet(), 49, "InternalProcessRecord", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\SystemConfigurationTasks\\TransportRule\\GetTransportRulePredicate.cs");

            TypeMapping[] availablePredicateMappings = TransportRulePredicate.GetAvailablePredicateMappings();
            if (string.IsNullOrEmpty(this.name))
            {
                foreach (TransportRulePredicate transportRulePredicate in TransportRulePredicate.CreateAllAvailablePredicates(availablePredicateMappings, session))
                {
                    if (enabled || (!(transportRulePredicate is SenderInRecipientListPredicate) && !(transportRulePredicate is RecipientInSenderListPredicate)))
                    {
                        base.WriteObject(transportRulePredicate);
                    }
                }
                return;
            }
            TransportRulePredicate transportRulePredicate2 = TransportRulePredicate.CreatePredicate(availablePredicateMappings, this.name, session);

            if (!enabled && (transportRulePredicate2 is SenderInRecipientListPredicate || transportRulePredicate2 is RecipientInSenderListPredicate))
            {
                transportRulePredicate2 = null;
            }
            if (transportRulePredicate2 == null)
            {
                base.WriteError(new ArgumentException(Strings.InvalidPredicate, "Name"), ErrorCategory.InvalidArgument, this.Name);
                return;
            }
            base.WriteObject(transportRulePredicate2);
        }
Esempio n. 3
0
 public GetTransportRule()
 {
     this.ruleCollectionName  = Utils.RuleCollectionNameFromRole();
     this.supportedPredicates = TransportRulePredicate.GetAvailablePredicateMappings();
     this.supportedActions    = TransportRuleAction.GetAvailableActionMappings();
     this.State = RuleState.Enabled;
     base.Fields.ResetChangeTracking();
 }
Esempio n. 4
0
        protected override void InternalValidate()
        {
            base.InternalValidate();
            TransportRule dataObject = this.DataObject;

            if (dataObject == null)
            {
                ExAssert.RetailAssert(false, "EnableTransportRule.InternalValidate data object is invalid");
            }
            TransportRule rule  = (TransportRule)TransportRuleParser.Instance.GetRule(dataObject.Xml);
            Rule          rule2 = Rule.CreateFromInternalRule(TransportRulePredicate.GetAvailablePredicateMappings(), TransportRuleAction.GetAvailableActionMappings(), rule, dataObject.Priority, dataObject);
            IEnumerable <RightsProtectMessageAction> source = (from action in rule2.Actions
                                                               where action is RightsProtectMessageAction
                                                               select action as RightsProtectMessageAction).ToList <RightsProtectMessageAction>();

            if (source.Any <RightsProtectMessageAction>())
            {
                if (!RmsClientManager.IRMConfig.IsInternalLicensingEnabledForTenant(base.CurrentOrganizationId))
                {
                    base.WriteError(new IrmLicensingIsDisabledException(), ErrorCategory.InvalidArgument, null);
                }
                RmsTemplateIdentity     template = source.First <RightsProtectMessageAction>().Template;
                RmsTemplateDataProvider session  = new RmsTemplateDataProvider((IConfigurationSession)base.DataSession);
                base.GetDataObject <RmsTemplatePresentation>(new RmsTemplateIdParameter(template), session, null, new LocalizedString?(Strings.OutlookProtectionRuleRmsTemplateNotFound(template.TemplateName)), new LocalizedString?(Strings.OutlookProtectionRuleRmsTemplateNotUnique(template.TemplateName)));
            }
            bool flag;

            if (!rule2.Actions.Any((TransportRuleAction action) => action is ApplyOMEAction))
            {
                flag = rule2.Actions.Any((TransportRuleAction action) => action is RemoveOMEAction);
            }
            else
            {
                flag = true;
            }
            bool flag2 = flag;

            if (flag2)
            {
                IRMConfiguration irmconfiguration = IRMConfiguration.Read((IConfigurationSession)base.DataSession);
                if (irmconfiguration == null || !irmconfiguration.InternalLicensingEnabled)
                {
                    base.WriteError(new E4eLicensingIsDisabledExceptionEnableRule(), ErrorCategory.InvalidArgument, null);
                }
                if (RmsClientManager.IRMConfig.GetRmsTemplate(base.CurrentOrganizationId, RmsTemplate.InternetConfidential.Id) == null)
                {
                    base.WriteError(new E4eRuleRmsTemplateNotFoundException(RmsTemplate.InternetConfidential.Name), ErrorCategory.InvalidArgument, null);
                }
            }
        }