public ExportTransportRuleCollection() { this.supportedPredicates = TransportRulePredicate.GetAvailablePredicateMappings(); this.supportedActions = TransportRuleAction.GetAvailableActionMappings(); base.RuleCollectionName = Utils.RuleCollectionNameFromRole(); this.Format = RuleCollectionFormat.RuleCollectionXML; }
public GetTransportRule() { this.ruleCollectionName = Utils.RuleCollectionNameFromRole(); this.supportedPredicates = TransportRulePredicate.GetAvailablePredicateMappings(); this.supportedActions = TransportRuleAction.GetAvailableActionMappings(); this.State = RuleState.Enabled; base.Fields.ResetChangeTracking(); }
protected override void InternalProcessRecord() { TypeMapping[] availableActionMappings = TransportRuleAction.GetAvailableActionMappings(); IConfigDataProvider session = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromRootOrgScopeSet(), 47, "InternalProcessRecord", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\SystemConfigurationTasks\\TransportRule\\GetTransportRuleAction.cs"); if (string.IsNullOrEmpty(this.name)) { foreach (TransportRuleAction sendToPipeline in TransportRuleAction.CreateAllAvailableActions(availableActionMappings, session)) { base.WriteObject(sendToPipeline); } return; } TransportRuleAction transportRuleAction = TransportRuleAction.CreateAction(availableActionMappings, this.name, session); if (transportRuleAction == null) { base.WriteError(new ArgumentException(Strings.InvalidAction, "Name"), ErrorCategory.InvalidArgument, this.Name); return; } base.WriteObject(transportRuleAction); }
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); } } }