/// <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); } }
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); }