public static Exception AccessDeniedToProtectedResource(AccessOutcome outcome) { Uri uri = outcome.Context.GenerateUri(); if (string.IsNullOrEmpty(outcome.AdditionalInfo)) { return(new AccessDeniedException(outcome, string.Format("Access to resource \"{0}\" was denied", uri))); } return(new AccessDeniedException(outcome, string.Format("Access to resource: {0} was denied, additional info: {1}", uri, outcome.AdditionalInfo))); }
public AccessDeniedException(AccessOutcome outcome) : this(outcome, null) { }
public AccessDeniedException(AccessOutcome outcome, string message) : base(message) { _outcome = outcome; }
public static Exception AccessDeniedToProtectedResource(AccessOutcome outcome) { Uri uri = outcome.Context.GenerateUri(); if (string.IsNullOrEmpty(outcome.AdditionalInfo)) { return new AccessDeniedException(outcome, string.Format("Access to resource \"{0}\" was denied", uri)); } return new AccessDeniedException(outcome, string.Format("Access to resource: {0} was denied, additional info: {1}", uri, outcome.AdditionalInfo)); }