diff --git a/console/src/modules/interface/themes/components/ThemeListModal.vue b/console/src/modules/interface/themes/components/ThemeListModal.vue index 390c54938e..691c3ca13f 100644 --- a/console/src/modules/interface/themes/components/ThemeListModal.vue +++ b/console/src/modules/interface/themes/components/ThemeListModal.vue @@ -20,8 +20,10 @@ import LocalUpload from "./list-tabs/LocalUpload.vue"; import RemoteDownload from "./list-tabs/RemoteDownload.vue"; import { usePluginModuleStore } from "@/stores/plugin"; import type { PluginModule, ThemeListTab } from "@halo-dev/console-shared"; +import { usePermission } from "@/utils/permission"; const { t } = useI18n(); +const { currentUserHasPermission } = usePermission(); const props = withDefaults( defineProps<{ @@ -115,7 +117,12 @@ onMounted(() => { return; } - const items = extensionPoints["theme:list:tabs:create"]() as ThemeListTab[]; + let items = extensionPoints["theme:list:tabs:create"]() as ThemeListTab[]; + + items = items.filter((item) => { + return currentUserHasPermission(item.permissions); + }); + tabsFromPlugins.push(...items); }); diff --git a/console/src/modules/system/plugins/components/PluginInstallationModal.vue b/console/src/modules/system/plugins/components/PluginInstallationModal.vue index fe7153a781..0184027326 100644 --- a/console/src/modules/system/plugins/components/PluginInstallationModal.vue +++ b/console/src/modules/system/plugins/components/PluginInstallationModal.vue @@ -16,8 +16,10 @@ import type { } from "@halo-dev/console-shared"; import { usePluginModuleStore } from "@/stores/plugin"; import { onMounted } from "vue"; +import { usePermission } from "@/utils/permission"; const { t } = useI18n(); +const { currentUserHasPermission } = usePermission(); const props = withDefaults( defineProps<{ @@ -92,10 +94,14 @@ onMounted(() => { return; } - const items = extensionPoints[ + let items = extensionPoints[ "plugin:installation:tabs:create" ]() as PluginInstallationTab[]; + items = items.filter((item) => { + return currentUserHasPermission(item.permissions); + }); + tabs.value.push(...items); });