private function serializeDesktopToolsConfig(Role $role)
    {
        $configs = [];
        $desktopTools = $this->om->getRepository(Tool::class)->findBy(['isDisplayableInDesktop' => true]);
        $toolsRole = $this->om->getRepository(ToolRole::class)->findBy(['role' => $role]);

        foreach ($toolsRole as $toolRole) {
            $toolName = $toolRole->getTool()->getName();

            if (!in_array($toolName, ToolsOptions::EXCLUDED_TOOLS)) {
                $configs[$toolName] = $toolRole->getDisplay();
            }
        }
        foreach ($desktopTools as $desktopTool) {
            $toolName = $desktopTool->getName();

            if (!in_array($toolName, ToolsOptions::EXCLUDED_TOOLS) && !isset($configs[$toolName])) {
                $configs[$toolName] = null;
            }
        }

        return 0 < count($configs) ? $configs : new \stdClass();
    }