private function checkRouteAccess($route, $permissions)
    {
        $permission_level = 0;
        
        if (array_key_exists($route, $permissions)) {
            $permission_level = $permissions->$route;
            
            // Check if type is bool, convert to int
            if (gettype($permission_level) == 'boolean') {
                $permission_level = ($permission_level ? 1 : 0);
            }
        }
        
        return $permission_level;
    }