protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
        {
            base.HandleUnauthorizedRequest(filterContext);

            IOTARedisService redisService = ObjectFactory.GetInstance<IOTARedisService>();

            Services.UserAccessDataControlService service = new UserAccessDataControlService(redisService);

            var currentUser = Membership.GetUser();

            if (currentUser != null)
            {
                var currentDesigncompany = service.GetDesignCompaniesByUser(currentUser.UserName)[0].Name;

                if (currentDesigncompany != null)
                {
                    filterContext.Result = new RedirectToRouteResult(
                                              new RouteValueDictionary
                                           {
                                               { "action", "LackOfPermission" },
                                               { "controller", filterContext.ActionDescriptor.ControllerDescriptor.ControllerName }
                                           });
                }
            }
        }
 public UserAccessDataControlServiceTest()
 {
     var realRedisService = new OTARedisService();
     userAccessDataControlService = new UserAccessDataControlService(realRedisService);
     realRedisService.FlushAll();
 }