private function softDelete(Page $page)
    {
        if ($page->isRoot()) {
            throw new BadRequestHttpException('Cannot remove root page of a site.');
        }

        $this->granted('DELETE', $page);
        $this->granted('EDIT', $page->getParent()); // user must have edit permission on parent

        if ($page->isOnline(true)) {
            $this->granted('PUBLISH', $page); // user must have publish permission on the page
        }

        $this->getPageRepository()->toTrash($page);
    }