Ejemplo n.º 1
0
 /// <summary>
 /// Processes an <see cref="AuthorizeActorResult"/> for an <see cref="ISecurityActor"> Actor</see>, adding it to the AuthorizationFailures collection if appropriate
 /// </summary>
 /// <param name="authorizeActorResult">Result to process</param>
 public void ProcessAuthorizeActorResult(AuthorizeActorResult authorizeActorResult)
 {
     if (!authorizeActorResult.IsAuthorized)
     {
         _authorizationFailures.Add(authorizeActorResult);
     }
 }
Ejemplo n.º 2
0
 public AuthorizeActorResult IsAuthorized(object actionToAuthorize)
 {
     var result = new AuthorizeActorResult(this);
     foreach (var rule in _rules)
     {
         try
         {
             if(!rule.IsAuthorized(actionToAuthorize))
                 result.AddBrokenRule(rule);
         }
         catch (Exception ex)
         {
             result.AddErrorRule(rule,ex);
         }
     }
     return result;
 }
Ejemplo n.º 3
0
        public AuthorizeActorResult IsAuthorized(object actionToAuthorize)
        {
            var result = new AuthorizeActorResult(this);

            foreach (var rule in _rules)
            {
                try
                {
                    if (!rule.IsAuthorized(actionToAuthorize))
                    {
                        result.AddBrokenRule(rule);
                    }
                }
                catch (Exception ex)
                {
                    result.AddErrorRule(rule, ex);
                }
            }
            return(result);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Processes an <see cref="AuthorizeActorResult"/> for an <see cref="ISecurityActor"> Actor</see>, adding it to the AuthorizationFailures collection if appropriate
 /// </summary>
 /// <param name="authorizeActorResult">Result to process</param>
 public void ProcessAuthorizeActorResult(AuthorizeActorResult authorizeActorResult)
 {
     if(!authorizeActorResult.IsAuthorized)
         _authorizationFailures.Add(authorizeActorResult);
 }