Exemple #1
0
        private static void AuditLog(Study study, List <UpdateItem> fields)
        {
            Platform.CheckForNullReference(study, "study");
            Platform.CheckForNullReference(fields, "fields");

            var helper =
                new DicomInstancesAccessedAuditHelper(ServerPlatform.AuditSource,
                                                      EventIdentificationContentsEventOutcomeIndicator.Success,
                                                      EventIdentificationContentsEventActionCode.U);

            helper.AddUser(new AuditPersonActiveParticipant(
                               SessionManager.Current.Credentials.UserName,
                               null,
                               SessionManager.Current.Credentials.DisplayName));

            var participant = new AuditStudyParticipantObject(study.StudyInstanceUid, study.AccessionNumber);

            string updateDescription = StringUtilities.Combine(
                fields, ";",
                item => String.Format("Tag=\"{0}\" Value=\"{1}\"", item.DicomTag.Name, item.Value)
                );

            participant.ParticipantObjectDetailString = updateDescription;
            helper.AddStudyParticipantObject(participant);
            ServerPlatform.LogAuditMessage(helper);
        }
        public static void RemoveAuthorityGroupAccess(string studyInstanceUid, string accessionNumber, IList <string> assignedGroups)
        {
            Platform.CheckForNullReference(studyInstanceUid, "studyInstanceUid");
            Platform.CheckForNullReference(assignedGroups, "assignedGroups");

            var helper =
                new DicomInstancesAccessedAuditHelper(ServerPlatform.AuditSource,
                                                      EventIdentificationContentsEventOutcomeIndicator.Success,
                                                      EventIdentificationContentsEventActionCode.U,
                                                      EventTypeCode.ObjectSecurityAttributesChanged);

            // TODO: 8/19/2011, Develop a way to get the DisplayName for the user here for the audit log message
            helper.AddUser(new AuditPersonActiveParticipant(
                               Thread.CurrentPrincipal.Identity.Name,
                               null,
                               null));


            var participant = new AuditStudyParticipantObject(studyInstanceUid, accessionNumber);

            string updateDescription = StringUtilities.Combine(
                assignedGroups, ";",
                item => String.Format("Removed Group Access=\"{0}\"", item)
                );

            participant.ParticipantObjectDetailString = updateDescription;
            helper.AddStudyParticipantObject(participant);

            ServerPlatform.LogAuditMessage(helper);
        }
        private void GenerateAuditLog()
        {
            var audit = new DicomInstancesAccessedAuditHelper(ServerPlatform.AuditSource, EventIdentificationContentsEventOutcomeIndicator.Success, EventIdentificationContentsEventActionCode.R /* Read*/);

            audit.AddUser(new AuditPersonActiveParticipant(SessionManager.Current.Credentials.UserName, null, SessionManager.Current.Credentials.DisplayName));

            var participant = new AuditStudyParticipantObject(_study.StudyInstanceUid, _study.AccessionNumber);

            participant.ParticipantObjectDetailString = string.Format("Partition: {0}", string.IsNullOrEmpty(_study.ThePartition.Description) ? _study.ThePartition.AeTitle : _study.ThePartition.Description);
            audit.AddStudyParticipantObject(participant);

            ServerAuditHelper.LogAuditMessage(audit);
        }