예제 #1
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;
 }
예제 #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);
        }