public override void Validate()
 {
     if (this.taskObject.IdentityData != null)
     {
         this.taskObject.IdentityData.ConfigurationContainerRdn = RuleIdParameter.GetRuleCollectionRdn(DlpUtils.OutOfBoxDlpPoliciesCollectionName);
     }
 }
Exemplo n.º 2
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);
            }
        }