protected override void WriteResult(IConfigurable dataObject)
        {
            AuditConfigurationRule auditConfigurationRule = new AuditConfigurationRule(dataObject as RuleStorage);

            auditConfigurationRule.PopulateTaskProperties();
            base.WriteResult(auditConfigurationRule);
        }
Beispiel #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();
        }
Beispiel #3
0
        private static void LoadAuditableOperationsInternal(OrganizationId orgId, Workload workload, out PolicyLoadStatus loadStatus, out PolicyAuditOperations operations)
        {
            loadStatus = PolicyLoadStatus.Unknown;
            operations = null;
            Guid guid;

            if (!AuditPolicyUtility.GetRuleGuidFromWorkload(workload, out guid))
            {
                return;
            }
            using (PolicyConfigProvider policyConfigProvider = PolicyConfigProviderManager <ExPolicyConfigProviderManager> .Instance.CreateForProcessingEngine(orgId))
            {
                if (policyConfigProvider != null)
                {
                    PolicyConfigConverterBase converterByType = PolicyConfigConverterTable.GetConverterByType(typeof(PolicyRuleConfig), true);
                    IConfigurable[]           array           = converterByType.GetFindStorageObjectsDelegate((ExPolicyConfigProvider)policyConfigProvider)(new ComparisonFilter(ComparisonOperator.Equal, ADObjectSchema.Name, guid.ToString()), ((ExPolicyConfigProvider)policyConfigProvider).GetPolicyConfigContainer(null), true, null);
                    if (array != null)
                    {
                        if (!array.Any <IConfigurable>())
                        {
                            loadStatus = PolicyLoadStatus.NotExist;
                        }
                        else
                        {
                            loadStatus = PolicyLoadStatus.FailedToLoad;
                            AuditConfigurationRule auditConfigurationRule = new AuditConfigurationRule((RuleStorage)array[0]);
                            auditConfigurationRule.PopulateTaskProperties();
                            loadStatus = PolicyLoadStatus.Loaded;
                            operations = new PolicyAuditOperations
                            {
                                AuditOperationsDelegate = auditConfigurationRule.AuditOperation
                            };
                        }
                    }
                }
            }
        }