Пример #1
0
        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;
 }
Пример #4
0
 public AccessDeniedException(AccessOutcome outcome)
     : this(outcome, null)
 {
 }
Пример #5
0
 public AccessDeniedException(AccessOutcome outcome, string message)
     : base(message)
 {
     _outcome = outcome;
 }
Пример #6
0
        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));
        }