mirror of
https://github.com/langgenius/dify.git
synced 2026-07-26 06:08:38 +08:00
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
14 lines
426 B
TypeScript
14 lines
426 B
TypeScript
'use client'
|
|
|
|
import { useAtomValue } from 'jotai'
|
|
import { workspacePermissionKeysAtom } from '@/context/permission-state'
|
|
import { hasPermission } from '@/utils/permission'
|
|
|
|
const AGENT_MANAGE_PERMISSION_KEY = 'agent.manage'
|
|
|
|
export const useCanManageAgents = () => {
|
|
const workspacePermissionKeys = useAtomValue(workspacePermissionKeysAtom)
|
|
|
|
return hasPermission(workspacePermissionKeys, AGENT_MANAGE_PERMISSION_KEY)
|
|
}
|