Exemple #1
0
        public override void OnAuthorization(HttpActionContext actionContext)
        {
            base.OnAuthorization(actionContext);

            if (!string.IsNullOrWhiteSpace(_action))
            {
                if (!ClaimsAuthorization.CheckAccess(_action, _resource))
                {
                    HandleUnauthorizedRequest(actionContext);
                }
            }
        }
Exemple #2
0
 protected override bool AuthorizeCore(System.Web.HttpContextBase httpContext)
 {
     if (!string.IsNullOrWhiteSpace(_action))
     {
         return(ClaimsAuthorization.CheckAccess(_action, _resource));
     }
     else
     {
         var filterContext = (AuthorizationContext)httpContext.Items[_authLabel];
         return(ChecAccess(filterContext));
     }
 }