AP0.6: Kairo Workspace UX mit Frontend Widget/View Registry und Vitest.
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Successful in 29s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 12s
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Successful in 29s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 12s
This commit is contained in:
1 parent
802c9259dc
commit
0e7184a59e
38 files changed
+2362
-386
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { useMemo } from 'react'
|
||||
import { useSession } from '../context/SessionContext.jsx'
|
||||
|
||||
export function useCapabilities() {
|
||||
const { context, entitlements } = useSession()
|
||||
|
||||
const capabilities = useMemo(() => {
|
||||
const fromContext = context?.capabilities || []
|
||||
const fromEntitlements = entitlements?.capabilities || []
|
||||
const merged = new Set([...fromContext, ...fromEntitlements])
|
||||
return merged
|
||||
}, [context, entitlements])
|
||||
|
||||
const hasCapability = (key) => {
|
||||
if (!key) return true
|
||||
return capabilities.has(key)
|
||||
}
|
||||
|
||||
return { capabilities, hasCapability }
|
||||
}
|
||||
Reference in new issue
Block a user