Пример #1
0
        public void OnAuthorization(AuthorizationContext filterContext)
        {
            var badge = HttpContext.Current.User.Identity.Name;

            PetaPoco.Database       db  = new PetaPoco.Database("DatabaseConn");
            ApplicationRightService ars = new ApplicationRightService(db);

            if (!ars.HaveRight(badge, _resourceName, _operationCode))
            {
                filterContext.Result = UtilHelper.Error("401", "您没有权限访问该模块", _isJsonResult);
            }
        }