public function checkForAllowedCTypes(array &$items, $pageId, $pageColumn, $gridContainerId, $gridColumn)
    {
        $allowed = [];
        $disallowed = [];
        if ((int)$pageColumn >= 0 || (int)$pageColumn === -2) {
            $column = $pageColumn ? $pageColumn : 0;
            $layout = $this->getSelectedBackendLayout($pageId);
        } else {
            $this->init($pageId);
            $column = $gridColumn ? (int)$gridColumn : 0;
            $gridElement = $this->layoutSetup->cacheCurrentParent($gridContainerId, true);
            $layout = $this->layoutSetup->getLayoutSetup($gridElement['tx_gridelements_backend_layout']);
        }
        if (!empty($layout)) {
            if (is_array($layout['allowed']) && is_array($layout['allowed'][$column]) && !empty($layout['allowed'][$column]['CType'])) {
                $allowed = $layout['allowed'][$column]['CType'];
            }
            if (is_array($layout['disallowed']) && is_array($layout['disallowed'][$column]) && !empty($layout['disallowed'][$column]['CType'])) {
                $disallowed = $layout['disallowed'][$column]['CType'];
            }
        }
        if (isset($layout) &&  (!empty($allowed) || !empty($disallowed))) {
            foreach ($items as $key => $item) {
                if ((
                        !empty($allowed) &&
                        !isset($allowed['*']) &&
                        !isset($allowed[$item[1]])
                    ) ||
                    (
                        !empty($disallowed) &&
                        (
                            isset($disallowed['*']) ||
                            isset($disallowed[$item[1]])
                        )
                    )) {
                    unset($items[$key]);
                }
            }
        }
    }