protected function setupUserProperties($route, $response, $denied)
    {
        /** @var \Octo\System\Model\User $user */
        $user = Store::get('User')->getByPrimaryKey($_SESSION['user_id']);

        if ($user && $user->getActive()) {
            $_SESSION['user'] = $user;

            $user->setDateActive(new \DateTime());
            Store::get('User')->save($user);

            $uri = '/';

            if ($route['controller'] != 'Dashboard') {
                $uri .= $route['controller'];
            }

            if ($route['action'] != 'index') {
                $uri .= '/' . $route['action'];
            }

            if (in_array($route['controller'], ['categories', 'media']) && isset($route['args'][0])) {
                $uri .= '/' . $route['args'][0];
            }

            if (!$user->canAccess($uri) && is_callable($denied)) {
                $denied($user, $uri, $response);
                return false;
            }

            return true;
        }
    }