Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: update permission logic to ensure administrators always have access (#17360)

Benjamine2b8f40275f6
diff --git a/web/app/components/plugins/plugin-page/use-permission.ts b/web/app/components/plugins/plugin-page/use-permission.ts
index c4fc01f2c3f..07790b63e80 100644
--- a/web/app/components/plugins/plugin-page/use-permission.ts
+++ b/web/app/components/plugins/plugin-page/use-permission.ts
@@ -5,15 +5,19 @@ import { useTranslation } from 'react-i18next'
import { useInvalidatePermissions, useMutationPermissions, usePermissions } from '@/service/use-plugins'
const hasPermission = (permission: PermissionType | undefined, isAdmin: boolean) => {
+ if (isAdmin)
+ return true // Administrators always have permissions
+
if (!permission)
return false
+
if (permission === PermissionType.noOne)
return false
if (permission === PermissionType.everyone)
return true
- return isAdmin
+ return false
}
const usePermission = () => {