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); }
public override void Start() { try { StartListening(ListenerCallback); } catch (HttpListenerException e) { // When the port is tied up by another process, the system throws HttpListenerException with error code = 32 // and the message "The process cannot access the file because it is being used by another process". // For clarity, we make the error message more informative in this case if (e.ErrorCode == WindowsErrorCodes.ERROR_SHARING_VIOLATION) { string errorMessage = string.Format("Unable to start {0} on port {1}. The port is being used by another process", _name, Port); Platform.Log(LogLevel.Fatal, errorMessage); ServerPlatform.Alert(AlertCategory.Application, AlertLevel.Critical, _name, AlertTypeCodes.UnableToStart, null, TimeSpan.Zero, errorMessage); } else { string errorMessage = string.Format("Unable to start {0}. System Error Code={1}", _name, e.ErrorCode); Platform.Log(LogLevel.Fatal, e, errorMessage); ServerPlatform.Alert(AlertCategory.Application, AlertLevel.Critical, _name, AlertTypeCodes.UnableToStart, null, TimeSpan.Zero, errorMessage); } } catch (Exception e) { Platform.Log(LogLevel.Fatal, e, "Unable to start {0}", _name); ServerPlatform.Alert(AlertCategory.Application, AlertLevel.Critical, _name, AlertTypeCodes.UnableToStart, null, TimeSpan.Zero, "Unable to start {0}: {1}", _name, e.Message); } }