usePermission
usePermission<
TSubjects,TData,TSubject>(props):boolean
Defined in: packages/react/src/hooks/usePermission.ts:16
Client-side permission check for UI affordances (advisory — server guards enforce).
Type Parameters
Section titled “Type Parameters”TSubjects
Section titled “TSubjects”TSubjects extends Record<string, SubjectEntry> = Record<string, SubjectEntry>
TData extends object = { }
TSubject
Section titled “TSubject”TSubject extends string = keyof TSubjects & string
Parameters
Section titled “Parameters”Omit<HasPermissionProps<TSubjects, TSubject, TData>, "user" | "organization" | "access">
The resource/action to check (plus optional data for an
exact per-doc check, and scope for how to resolve a callback matrix
entry when data is omitted); see HasPermissionProps in @vexcms/core
for the full property set.
Returns
Section titled “Returns”boolean
false when no access/user (fail-closed).