Пример #1
0
        public override void OnAuthorization(AuthorizationContext filterContext)
        {
            if (filterContext.HasAttribute(typeof(AllowAnonymousAttribute)))
            {
                return;
            }

            var username = HttpContext.Current.Session[SessionConstant.userid];

            if (username == null)
            {
                filterContext.RedirectToLogin();
            }
            else
            {
                if (filterContext.NonCheckAction())
                {
                    return;
                }
            }
        }