Skip to content

Function: useHasRole() ​

ts
function useHasRole(role): boolean;

Defined in: packages/react/src/context.tsx:67

true if the user has the role — or ANY of the roles when given an array.

Parameters ​

ParameterType
roleMany<string>

Returns ​

boolean

Released under the MIT License. Inspired by spatie/laravel-permission.