diff --git a/web/app/components/plugins/card/index.tsx b/web/app/components/plugins/card/index.tsx
index 506c740d64..1cc18ac24f 100644
--- a/web/app/components/plugins/card/index.tsx
+++ b/web/app/components/plugins/card/index.tsx
@@ -15,7 +15,6 @@ import { renderI18nObject } from '@/i18n'
import { useMixedTranslation } from '@/app/components/plugins/marketplace/hooks'
import Partner from '../base/badges/partner'
import Verified from '../base/badges/verified'
-import { RiProhibitedLine } from '@remixicon/react'
export type Props = {
className?: string
@@ -90,10 +89,6 @@ const Card = ({
text={getLocalizedText(brief)}
descriptionLineRows={descriptionLineRows}
/>
-
-
- {t('plugin.installModal.installWarning')}
-
{footer && {footer}
}
)
diff --git a/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx b/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx
index 41b08838ff..13d4f88fbc 100644
--- a/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx
+++ b/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.tsx
@@ -1,5 +1,6 @@
'use client'
import type { FC } from 'react'
+import { useState } from 'react'
import React, { useEffect, useMemo } from 'react'
// import { RiInformation2Line } from '@remixicon/react'
import { type Plugin, type PluginManifestInMarket, TaskStatus } from '../../../types'
@@ -7,7 +8,7 @@ import Card from '../../../card'
import { pluginManifestInMarketToPluginProps } from '../../utils'
import Button from '@/app/components/base/button'
import { useTranslation } from 'react-i18next'
-import { RiLoader2Line } from '@remixicon/react'
+import { RiLoader2Line, RiProhibitedLine } from '@remixicon/react'
import { useInstallPackageFromMarketPlace, usePluginDeclarationFromMarketPlace, useUpdatePackageFromMarketPlace } from '@/service/use-plugins'
import checkTaskStatus from '../../base/check-task-status'
import useCheckInstalled from '@/app/components/plugins/install-plugin/hooks/use-check-installed'
@@ -15,6 +16,9 @@ import Version from '../../base/version'
import { usePluginTaskList } from '@/service/use-plugins'
import { gte } from 'semver'
import { useAppContext } from '@/context/app-context'
+import { useGlobalPublicStore } from '@/context/global-public-context'
+import { isEmpty } from 'lodash-es'
+import { InstallationScope } from '@/types/feature'
const i18nPrefix = 'plugin.installModal'
@@ -126,6 +130,22 @@ const Installed: FC = ({
return gte(langeniusVersionInfo.current_version, pluginDeclaration?.manifest.meta.minimum_dify_version ?? '0.0.0')
}, [langeniusVersionInfo.current_version, pluginDeclaration])
+ const systemFeatures = useGlobalPublicStore(s => s.systemFeatures)
+
+ const [canInstallPlugin, setCanInstallPlugin] = useState(true)
+
+ useEffect(() => {
+ const verification = (isEmpty(payload.verification) ? { authorized_category: 'langgenius' } : payload.verification) as { authorized_category: string }
+ if (systemFeatures.plugin_installation_permission.plugin_installation_scope === InstallationScope.ALL) setCanInstallPlugin(true)
+ else if (systemFeatures.plugin_installation_permission.plugin_installation_scope === InstallationScope.NONE) setCanInstallPlugin(false)
+ else if (systemFeatures.plugin_installation_permission.plugin_installation_scope === InstallationScope.OFFICIAL_ONLY)
+ setCanInstallPlugin(verification.authorized_category === 'langgenius')
+ else if (systemFeatures.plugin_installation_permission.plugin_installation_scope === InstallationScope.OFFICIAL_AND_PARTNER)
+ setCanInstallPlugin(verification.authorized_category === 'langgenius' || verification.authorized_category === 'partner')
+ else
+ setCanInstallPlugin(false)
+ }, [systemFeatures, payload])
+
return (
<>
@@ -148,6 +168,10 @@ const Installed: FC
= ({
/>}
/>
+ {!canInstallPlugin &&
+
+ {t('plugin.installModal.installWarning')}
+
}
{/* Action Buttons */}
@@ -159,7 +183,7 @@ const Installed: FC
= ({