Skip to content

frontend


Function: useHasCompetency()

useHasCompetency(competency): boolean

Defined in: src/lib/cbac/hooks.ts:22

Check if current user has a specific competency

Parameters

competency

string

Competency ID to check

Returns

boolean

true if user has the competency

Example

const canPrescribe = useHasCompetency("prescribe_controlled_schedule_2");
if (!canPrescribe) return null; // Hide component