예제 #1
0
        public override AuthorizationRight IsAuthorized(IFubuRequest request, IEnumerable <IAuthorizationPolicy> policies)
        {
            var decision = base.IsAuthorized(request, policies);

            if (policies.Any())
            {
                var authorizationReport = new AuthorizationReport();
                policies.Each(p =>
                {
                    var rights = p.RightsFor(request);
                    authorizationReport.AddVote(p.ToString(), rights.Name);
                });
                authorizationReport.Decision = decision.Name;
                _report.AddDetails(authorizationReport);
            }
            return(decision);
        }
 public override AuthorizationRight IsAuthorized(IFubuRequest request, IEnumerable<IAuthorizationPolicy> policies)
 {
     var decision = base.IsAuthorized(request, policies);
     if (policies.Any())
     {
         var authorizationReport = new AuthorizationReport();
         policies.Each(p =>
         {
             var rights = p.RightsFor(request);
             authorizationReport.AddVote(p.ToString(), rights.Name);
         });
         authorizationReport.Decision = decision.Name;
         _report.AddDetails(authorizationReport);
     }
     return decision;
 }