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.