protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (this.manager != null)
     {
         RecipientTaskHelper.CheckRecipientInSameOrganizationWithDataObject(this.DataObject, this.manager, new Task.ErrorLoggerDelegate(base.WriteError));
     }
     if (this.grantSendOnBehalfTo != null)
     {
         foreach (ADRecipient recipient in this.grantSendOnBehalfTo)
         {
             RecipientTaskHelper.CheckRecipientInSameOrganizationWithDataObject(this.DataObject, recipient, new Task.ErrorLoggerDelegate(base.WriteError));
         }
     }
     if (this.bypassModerationFromRecipient != null)
     {
         foreach (ADRecipient recipient2 in this.bypassModerationFromRecipient)
         {
             RecipientTaskHelper.CheckRecipientInSameOrganizationWithDataObject(this.DataObject, recipient2, new Task.ErrorLoggerDelegate(base.WriteError));
         }
     }
     if (this.bypassModerationFromDLMembersRecipient != null)
     {
         foreach (ADRecipient recipient3 in this.bypassModerationFromDLMembersRecipient)
         {
             RecipientTaskHelper.CheckRecipientInSameOrganizationWithDataObject(this.DataObject, recipient3, new Task.ErrorLoggerDelegate(base.WriteError));
         }
     }
     TaskLogger.LogExit();
 }
Esempio n. 2
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (this.intendedMailboxPlanObject != null)
     {
         RecipientTaskHelper.CheckRecipientInSameOrganizationWithDataObject(this.DataObject, this.intendedMailboxPlanObject, new Task.ErrorLoggerDelegate(base.WriteError));
     }
     TaskLogger.LogExit();
 }
Esempio n. 3
0
        protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            base.InternalValidate();
            TDataObject dataObject = this.DataObject;

            if (dataObject.IsModified(ADOrgPersonSchema.UMCallingLineIds))
            {
                this.ValidateUMCallingLineIds();
            }
            if (this.manager != null)
            {
                RecipientTaskHelper.CheckRecipientInSameOrganizationWithDataObject(this.DataObject, this.manager, new Task.ErrorLoggerDelegate(base.WriteError));
            }
            TaskLogger.LogExit();
        }
Esempio n. 4
0
        private MultiValuedProperty <ADObjectId> ConstructADObjectIdAndValidate(RecipientIdParameter[] idList)
        {
            MultiValuedProperty <ADObjectId> multiValuedProperty = null;

            if (idList != null && idList.Length > 0)
            {
                multiValuedProperty = new MultiValuedProperty <ADObjectId>();
                foreach (RecipientIdParameter recipientIdParameter in idList)
                {
                    ADRecipient adrecipient = (ADRecipient)base.GetDataObject <ADRecipient>(recipientIdParameter, base.TenantGlobalCatalogSession, null, new LocalizedString?(Strings.ErrorRecipientNotFound(recipientIdParameter.ToString())), new LocalizedString?(Strings.ErrorRecipientNotUnique(recipientIdParameter.ToString())));
                    RecipientTaskHelper.CheckRecipientInSameOrganizationWithDataObject(this.DataObject, adrecipient, new Task.ErrorLoggerDelegate(base.WriteError));
                    multiValuedProperty.Add(adrecipient.Id);
                }
            }
            return(multiValuedProperty);
        }
Esempio n. 5
0
        protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            if (!base.Fields.Contains("Mailbox"))
            {
                SharedConfigurationTaskHelper.VerifyIsNotTinyTenant(base.CurrentOrgState, new Task.ErrorLoggerDelegate(base.WriteError));
            }
            if (base.ParameterSetName == "ParameterSetMailboxTask")
            {
                return;
            }
            if (base.Fields.IsModified("LegacyManagedFolder"))
            {
                if (this.LegacyManagedFolder != null)
                {
                    ELCFolder elcfolder = (ELCFolder)base.GetDataObject <ELCFolder>(this.LegacyManagedFolder, base.DataSession, null, new LocalizedString?(Strings.ErrorElcFolderNotFound(this.LegacyManagedFolder.ToString())), new LocalizedString?(Strings.ErrorAmbiguousElcFolderId(this.LegacyManagedFolder.ToString())));
                    this.DataObject.LegacyManagedFolder = elcfolder.Id;
                }
                else
                {
                    this.DataObject.LegacyManagedFolder = null;
                }
            }
            base.InternalValidate();
            if (this.contentSettingsObject.IsChanged(ElcContentSettingsSchema.RetentionAction))
            {
                RetentionActionType[] source = new RetentionActionType[]
                {
                    RetentionActionType.MoveToFolder
                };
                if (source.Any((RetentionActionType x) => x == this.contentSettingsObject.RetentionAction))
                {
                    base.WriteError(new RetentionPolicyTagTaskException(Strings.ErrorRetentionActionNowAllowed), ErrorCategory.InvalidOperation, null);
                }
                if (this.DataObject.Type == ElcFolderType.RecoverableItems && !this.contentSettingsObject.RetentionAction.Equals(RetentionActionType.MoveToArchive))
                {
                    base.WriteError(new ArgumentException(Strings.ErrorDumpsterTagWrongRetentionAction), ErrorCategory.InvalidArgument, this);
                }
                if (this.DataObject.Type != ElcFolderType.All && this.DataObject.Type != ElcFolderType.Personal && this.DataObject.Type != ElcFolderType.RecoverableItems && this.RetentionAction == RetentionActionType.MoveToArchive)
                {
                    base.WriteError(new RetentionPolicyTagTaskException(Strings.ErrorMoveToArchiveAppliedToSystemFolder), ErrorCategory.InvalidArgument, null);
                }
            }
            if (this.contentSettingsObject.IsChanged(ElcContentSettingsSchema.MessageClass) && this.DataObject.Type != ElcFolderType.All && !this.contentSettingsObject.MessageClass.Equals(ElcMessageClass.AllMailboxContent))
            {
                base.WriteError(new RetentionPolicyTagTaskException(Strings.ErrorOnlyDefaultTagAllowCustomizedMessageClass), ErrorCategory.InvalidOperation, this.DataObject);
            }
            string tagName;

            if (this.DataObject.IsChanged(RetentionPolicyTagSchema.RetentionId) && !(base.DataSession as IConfigurationSession).CheckForRetentionTagWithConflictingRetentionId(this.DataObject.RetentionId, this.DataObject.Identity.ToString(), out tagName))
            {
                base.WriteError(new RetentionPolicyTagTaskException(Strings.ErrorRetentionIdConflictsWithRetentionTag(this.DataObject.RetentionId.ToString(), tagName)), ErrorCategory.InvalidOperation, this.DataObject);
            }
            if (this.contentSettingsObject.IsChanged(ElcContentSettingsSchema.RetentionAction) || this.contentSettingsObject.IsChanged(ElcContentSettingsSchema.RetentionEnabled) || this.contentSettingsObject.IsChanged(ElcContentSettingsSchema.MessageClass))
            {
                this.ValidateRetentionPolicy();
            }
            if (base.Fields.IsModified("AddressForJournaling"))
            {
                if (this.AddressForJournaling != null)
                {
                    ADRecipient adrecipient = (ADRecipient)base.GetDataObject <ADRecipient>(this.AddressForJournaling, base.TenantGlobalCatalogSession, null, new LocalizedString?(Strings.ErrorMailboxAddressNotFound(this.AddressForJournaling.ToString())), new LocalizedString?(Strings.ErrorMailboxAddressNotUnique(this.AddressForJournaling.ToString())));
                    if (!this.DataObject.OrganizationId.Equals(OrganizationId.ForestWideOrgId))
                    {
                        RecipientTaskHelper.CheckRecipientInSameOrganizationWithDataObject(this.DataObject, adrecipient, new Task.ErrorLoggerDelegate(base.WriteError));
                    }
                    if (adrecipient.EmailAddresses == null || adrecipient.EmailAddresses.FindPrimary(ProxyAddressPrefix.Smtp) == null)
                    {
                        base.WriteError(new ArgumentException(Strings.SmtpAddressMissingForAutocopy(this.AddressForJournaling.ToString()), "AddressForJournaling"), ErrorCategory.InvalidData, this);
                    }
                    this.contentSettingsObject.AddressForJournaling = adrecipient.Id;
                }
                else
                {
                    this.contentSettingsObject.AddressForJournaling = null;
                }
            }
            ValidationError[] array = this.contentSettingsObject.Validate();
            if (array.Length > 0)
            {
                for (int i = 0; i < array.Length; i++)
                {
                    this.WriteError(new DataValidationException(array[i]), (ErrorCategory)1003, this.contentSettingsObject.Identity, array.Length - 1 == i);
                }
            }
            if (base.HasErrors)
            {
                return;
            }
            TaskLogger.LogExit();
        }