Exemplo n.º 1
0
        /// <summary>
        ///     Called to write save audit log entries.
        /// </summary>
        /// <param name="success">if set to <c>true</c> [success].</param>
        /// <param name="accessRuleDetails">The access rule details.</param>
        protected override void OnWriteSaveAuditLogEntries(bool success, AuditLogAccessRuleDetails accessRuleDetails)
        {
            if (accessRuleDetails.IsTemporaryId)
            {
                // Access rule is being created
                AuditLog.OnCreateAccessRule(success, accessRuleDetails.SubjectName, accessRuleDetails.SecuredTypeName);
            }

            if (!accessRuleDetails.IsTemporaryId &&
                accessRuleDetails.OldPermissions.Count > 0 || accessRuleDetails.NewPermissions.Count > 0)
            {
                // Access rule permissions have changed
                AuditLog.OnChangeAccessRulePermissions(success, accessRuleDetails.SubjectName, accessRuleDetails.SecuredTypeName,
                                                       accessRuleDetails.AccessRuleReportName, accessRuleDetails.OldPermissions, accessRuleDetails.NewPermissions);
            }

            if (!accessRuleDetails.IsTemporaryId &&
                accessRuleDetails.Enabled != accessRuleDetails.OldEnabled)
            {
                // Access rule enabled state has changed
                AuditLog.OnEnableAccessRule(success, accessRuleDetails.SubjectName, accessRuleDetails.SecuredTypeName, accessRuleDetails.AccessRuleReportName,
                                            accessRuleDetails.OldEnabled, accessRuleDetails.Enabled);
            }

            if (!accessRuleDetails.IsTemporaryId &&
                accessRuleDetails.IsAccessRuleReportChanged)
            {
                // Access rule query has changed
                AuditLog.OnChangeAccessRuleQuery(success, accessRuleDetails.SubjectName, accessRuleDetails.SecuredTypeName, accessRuleDetails.AccessRuleReportName);
            }
        }