dify/web/features/agent-v2/permissions.ts
Xiyuan Chen 86134ea99e
feat(rbac): agent RBAC/ACL scenes and resource-locator check bundles (#41768)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-07 04:39:43 +00:00

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)
}