protected override IConfigurable PrepareDataObject()
        {
            RuleStorage ruleStorage = (RuleStorage)base.PrepareDataObject();

            ruleStorage.Name = this.Name;
            ruleStorage.SetId(((ADObjectId)this.policyStorage.Identity).GetChildId(this.Name));
            AuditConfigurationRule auditConfigurationRule = new AuditConfigurationRule(ruleStorage)
            {
                Policy         = Utils.GetUniversalIdentity(this.policyStorage),
                Workload       = this.policyStorage.Workload,
                AuditOperation = this.AuditOperation
            };

            auditConfigurationRule.UpdateStorageProperties();
            return(ruleStorage);
        }
Ejemplo n.º 2
0
        protected override void StampChangesOn(IConfigurable dataObject)
        {
            RuleStorage ruleStorage = (RuleStorage)dataObject;

            ruleStorage.ResetChangeTracking(true);
            AuditConfigurationRule auditConfigurationRule = new AuditConfigurationRule(dataObject as RuleStorage);

            auditConfigurationRule.PopulateTaskProperties();
            if (ruleStorage.Mode == Mode.PendingDeletion)
            {
                base.WriteError(new ErrorCommonComplianceRuleIsDeletedException(ruleStorage.Name), ErrorCategory.InvalidOperation, null);
            }
            base.StampChangesOn(dataObject);
            auditConfigurationRule.CopyChangesFrom(base.DynamicParametersInstance);
            auditConfigurationRule.AuditOperation = this.AuditOperation;
            auditConfigurationRule.UpdateStorageProperties();
        }