Skip to main content
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:
boolean
A boolean indicating whether the authentication state is still being loaded.
Permission[]
The list of permissions the user has.
Quota[]
The list of quotas the user has including the limit, the usage and remaining credit.
function(permissionName: string | string[]) => boolean
A function to check if the user has a specific permission.
function(quotaName: string | string[]) => boolean
A function to check if the user has remaining quota for a specific quota.

Examples

List user’s permissions

List user’s quotas usage

Check if user has a specific permission

Check if user has remaining quota