mirror of
https://github.com/langgenius/dify.git
synced 2026-09-08 02:43:49 +08:00
14 lines
433 B
TypeScript
14 lines
433 B
TypeScript
'use client'
|
|
|
|
import { useAtomValue } from 'jotai'
|
|
import { workspacePermissionKeysAtom } from '@/context/permission-state'
|
|
import { hasPermission } from '@/utils/permission'
|
|
|
|
const AGENT_PREVIEW_PERMISSION_KEY = 'agent.acl.preview'
|
|
|
|
export const useCanManageAgents = () => {
|
|
const workspacePermissionKeys = useAtomValue(workspacePermissionKeysAtom)
|
|
|
|
return hasPermission(workspacePermissionKeys, AGENT_PREVIEW_PERMISSION_KEY)
|
|
}
|