diff --git a/web/app/components/plugins/permission-setting-modal/modal.tsx b/web/app/components/plugins/permission-setting-modal/modal.tsx index 4c59bdc0ca..67fed1ad0c 100644 --- a/web/app/components/plugins/permission-setting-modal/modal.tsx +++ b/web/app/components/plugins/permission-setting-modal/modal.tsx @@ -49,7 +49,7 @@ const PluginSettingModal: FC = ({
{[ - { title: t(`${i18nPrefix}.whoCanInstall`), key: 'canInstall', value: tempPrivilege.canInstall }, + { title: t(`${i18nPrefix}.whoCanInstall`), key: 'canManagement', value: tempPrivilege.canManagement }, { title: t(`${i18nPrefix}.whoCanDebug`), key: 'canDebugger', value: tempPrivilege.canDebugger }, ].map(({ title, key, value }) => (
diff --git a/web/app/components/plugins/plugin-page/context.tsx b/web/app/components/plugins/plugin-page/context.tsx index edf0591f81..3d714f8aa0 100644 --- a/web/app/components/plugins/plugin-page/context.tsx +++ b/web/app/components/plugins/plugin-page/context.tsx @@ -22,7 +22,7 @@ export type PluginPageContextValue = { export const PluginPageContext = createContext({ containerRef: { current: null }, permissions: { - canInstall: PermissionType.noOne, + canManagement: PermissionType.noOne, canDebugger: PermissionType.noOne, }, setPermissions: () => { }, @@ -41,7 +41,7 @@ export const PluginPageContextProvider = ({ }: PluginPageContextProviderProps) => { const containerRef = useRef(null) const [permissions, setPermissions] = useState({ - canInstall: PermissionType.noOne, + canManagement: PermissionType.noOne, canDebugger: PermissionType.noOne, }) diff --git a/web/app/components/plugins/plugin-page/index.tsx b/web/app/components/plugins/plugin-page/index.tsx index 3aee11c352..d51a0270f8 100644 --- a/web/app/components/plugins/plugin-page/index.tsx +++ b/web/app/components/plugins/plugin-page/index.tsx @@ -36,7 +36,7 @@ const PluginPage = ({ }: PluginPageProps) => { const { t } = useTranslation() const { - canInstall, + canManagement, canDebugger, canSetPermissions, permissions, @@ -88,7 +88,7 @@ const PluginPage = ({ />
- {canInstall && ( + {canManagement && ( )} { diff --git a/web/app/components/plugins/plugin-page/use-permission.ts b/web/app/components/plugins/plugin-page/use-permission.ts index 583839be94..fe3f64531b 100644 --- a/web/app/components/plugins/plugin-page/use-permission.ts +++ b/web/app/components/plugins/plugin-page/use-permission.ts @@ -23,12 +23,12 @@ const usePermission = () => { useEffect(() => { // TODO: fetch permissions from server setPermissions({ - canInstall: PermissionType.everyone, + canManagement: PermissionType.everyone, canDebugger: PermissionType.everyone, }) }, []) return { - canInstall: hasPermission(permissions.canInstall, isAdmin), + canManagement: hasPermission(permissions.canManagement, isAdmin), canDebugger: hasPermission(permissions.canDebugger, isAdmin), canSetPermissions: isAdmin, permissions, diff --git a/web/app/components/plugins/types.ts b/web/app/components/plugins/types.ts index d5b5098ab7..a14f7825da 100644 --- a/web/app/components/plugins/types.ts +++ b/web/app/components/plugins/types.ts @@ -33,6 +33,6 @@ export enum PermissionType { } export type Permissions = { - canInstall: PermissionType + canManagement: PermissionType canDebugger: PermissionType }