Exemple #1
0
        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);
        }
        /// <summary>
        /// Add details of a study.
        /// </summary>
        /// <param name="study"></param>
        public void AddStudyParticipantObject(AuditStudyParticipantObject study)
        {
            // if the participant object contains no identifying information anyway, there's no need to add it to the audit message
            var key = study.StudyInstanceUid;

            if (!string.IsNullOrEmpty(key))
            {
                InternalAddParticipantObject(key, study);
            }
        }
        protected void InternalAddStorageInstance(StorageInstance instance)
        {
            if (_participantObjectList.ContainsKey(instance.StudyInstanceUid))
            {
                AuditStudyParticipantObject study = _participantObjectList[instance.StudyInstanceUid] as AuditStudyParticipantObject;

                if (study != null)
                {
                    study.AddStorageInstance(instance);
                }
            }
            else
            {
                AuditStudyParticipantObject o = new AuditStudyParticipantObject(instance.StudyInstanceUid);
                o.AddStorageInstance(instance);
                _participantObjectList.Add(instance.StudyInstanceUid, o);
            }
        }
Exemple #4
0
 /// <summary>
 /// Add details of a study.
 /// </summary>
 /// <param name="study"></param>
 public void AddStudyParticipantObject(AuditStudyParticipantObject study)
 {
     InternalAddParticipantObject(study.StudyInstanceUid, study);
 }
        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);
        }
		protected void InternalAddStorageInstance(StorageInstance instance)
		{
			if (_participantObjectList.ContainsKey(instance.StudyInstanceUid))
			{
				AuditStudyParticipantObject study = _participantObjectList[instance.StudyInstanceUid] as AuditStudyParticipantObject;

				if (study!=null)
				{
					study.AddStorageInstance(instance);
				}
			}
			else
			{
				AuditStudyParticipantObject o = new AuditStudyParticipantObject(instance.StudyInstanceUid);
				o.AddStorageInstance(instance);
				_participantObjectList.Add(instance.StudyInstanceUid, o);
			}
		}
		/// <summary>
		/// Add details of a study.
		/// </summary>
		/// <param name="study"></param>
		public void AddStudyParticipantObject(AuditStudyParticipantObject study)
		{
			InternalAddParticipantObject(study.StudyInstanceUid, study);
		}
	    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);

        }
		/// <summary>
		/// Add details of a study.
		/// </summary>
		/// <param name="study"></param>
		public void AddStudyParticipantObject(AuditStudyParticipantObject study)
		{
			// if the participant object contains no identifying information anyway, there's no need to add it to the audit message
			var key = study.StudyInstanceUid;
			if (!string.IsNullOrEmpty(key))
				InternalAddParticipantObject(key, study);
		}