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