public override void Validate()
 {
     if (this.taskObject.IdentityData != null)
     {
         this.taskObject.IdentityData.ConfigurationContainerRdn = RuleIdParameter.GetRuleCollectionRdn(DlpUtils.OutOfBoxDlpPoliciesCollectionName);
     }
 }
示例#2
0
 public static ADObjectId GetRuleCollectionId(IConfigDataProvider session)
 {
     if (session == null)
     {
         throw new ArgumentNullException("session");
     }
     return(RuleIdParameter.GetRuleCollectionId(session, "OutlookProtectionRules"));
 }
示例#3
0
        protected override void InternalValidate()
        {
            if (base.OptionalIdentityData != null)
            {
                base.OptionalIdentityData.ConfigurationContainerRdn = RuleIdParameter.GetRuleCollectionRdn(this.ruleCollectionName);
            }
            this.DataObject = (TransportRule)this.ResolveDataObject();
            if (this.DataObject != null)
            {
                base.CurrentOrganizationId = this.DataObject.OrganizationId;
            }
            if (!this.DataObject.OrganizationId.Equals(OrganizationId.ForestWideOrgId) && !((IDirectorySession)base.DataSession).SessionSettings.CurrentOrganizationId.Equals(this.DataObject.OrganizationId))
            {
                base.UnderscopeDataSession(this.DataObject.OrganizationId);
            }
            if (base.HasErrors)
            {
                return;
            }
            if (!Utils.IsChildOfRuleContainer(this.Identity, this.ruleCollectionName))
            {
                throw new ManagementObjectNotFoundException(base.GetErrorMessageObjectNotFound((this.Identity != null) ? this.Identity.ToString() : null, typeof(RuleIdParameter).ToString(), (base.DataSession != null) ? base.DataSession.Source : null));
            }
            Exception exception;
            string    target;

            if (!Utils.ValidateRecipientIdParameters(base.Fields, base.TenantGlobalCatalogSession, new DataAccessHelper.GetDataObjectDelegate(base.GetDataObject <ADRecipient>), out exception, out target))
            {
                base.WriteError(exception, ErrorCategory.InvalidArgument, target);
            }
            try
            {
                Utils.BuildConditionsAndExceptionsFromParameters(base.Fields, base.TenantGlobalCatalogSession, base.DataSession, false, out this.conditionTypesToUpdate, out this.exceptionTypesToUpdate, out this.conditionsSetByParameters, out this.exceptionsSetByParameters);
            }
            catch (TransientException exception2)
            {
                base.WriteError(exception2, ErrorCategory.InvalidArgument, this.Name);
            }
            catch (DataValidationException exception3)
            {
                base.WriteError(exception3, ErrorCategory.InvalidArgument, this.Name);
            }
            catch (ArgumentException exception4)
            {
                base.WriteError(exception4, ErrorCategory.InvalidArgument, this.Name);
            }
        }
示例#4
0
 public static bool IsChildOfOutlookProtectionRuleContainer(RuleIdParameter ruleId)
 {
     return(ruleId == null || ruleId.InternalADObjectId == null || ruleId.InternalADObjectId.Parent == null || string.Equals(ruleId.InternalADObjectId.Parent.Name, "OutlookProtectionRules", StringComparison.OrdinalIgnoreCase));
 }