Search
Search
useIsAllowedTo
useIsAllowedTo
useIsAllowedTo
Find out if user's permissions allow them to execute methods, in hook form.
const isAllowed = useIsAllowedTo("addText", "addImage")
<button disabled={!isAllowed}>+<
Signature
useIsAllowedTo: (
...methods: [ProtectedMethod, ...ProtectedMethod[]]
) => boolean
Parameters
methods
– The methods to check, at least one.
Returns
boolean
–true
if all ofmethods
can be executed,false
otherwise.
Notes
Learn more with the Permission guide.