/// <summary> /// Processes instance of an <see cref="AuthorizeDescriptorResult"/>, adding failed authorizations to the AuthorizationFailures collection /// </summary> /// <param name="result">Result to process</param> public void ProcessAuthorizeDescriptorResult(AuthorizeDescriptorResult result) { if (!result.IsAuthorized) { _authorizationFailures.Add(result); } }
public AuthorizeDescriptorResult Authorize(object instanceToAuthorize) { var result = new AuthorizeDescriptorResult(); foreach (var action in Actions.Where(a => a.CanAuthorize(instanceToAuthorize))) { result.ProcessAuthorizeActionResult(action.Authorize(instanceToAuthorize)); } return(result); }
/// <summary> /// Processes instance of an <see cref="AuthorizeDescriptorResult"/>, adding failed authorizations to the AuthorizationFailures collection /// </summary> /// <param name="result">Result to process</param> public void ProcessAuthorizeDescriptorResult(AuthorizeDescriptorResult result) { if (!result.IsAuthorized) _authorizationFailures.Add(result); }