Hooks (client-side)
useAccessControl()
The useAccessControl()
hook is used to check if the user has a specific permission or has reached a specific quota programmatically from the frontend.
Returns
An object with the following properties:
A boolean indicating whether the authentication state is still being loaded.
The list of permissions the user has.
The list of quotas the user has including the limit, the usage and remaining credit.
A function to check if the user has a specific permission.
A function to check if the user has remaining quota for a specific quota.