/// <summary>
 /// Processes instance of an <see cref="AuthorizeActionResult"/>, adding failed authorizations to the AuthorizationFailures collection.
 /// </summary>
 /// <param name="result">Result to process.</param>
 public void ProcessAuthorizeActionResult(AuthorizeActionResult result)
 {
     if (!result.IsAuthorized)
     {
         _authorizationFailures.Add(result);
     }
 }
Beispiel #2
0
        public AuthorizeActionResult Authorize(object actionToAuthorize)
        {
            var result = new AuthorizeActionResult(this);

            foreach (var target in Targets.Where(t => t.CanAuthorize(actionToAuthorize)))
            {
                result.ProcessAuthorizeTargetResult(target.Authorize(actionToAuthorize));
            }
            return(result);
        }