docs: remove unnecessary await in permission checks (#2859)

This commit is contained in:
Felipe Rocha
2025-05-31 18:27:16 -03:00
committed by GitHub
parent a8c65d9871
commit fa1e702912

View File

@@ -845,7 +845,7 @@ const canCreateProjectAndCreateSale = await authClient.organization.hasPermissio
Once you have defined the roles and permissions to avoid checking the permission from the server you can use the `checkRolePermission` function provided by the client. Once you have defined the roles and permissions to avoid checking the permission from the server you can use the `checkRolePermission` function provided by the client.
```ts title="auth-client.ts" ```ts title="auth-client.ts"
const canCreateProject = await authClient.organization.checkRolePermission({ const canCreateProject = authClient.organization.checkRolePermission({
permissions: { permissions: {
organization: ["delete"], organization: ["delete"],
}, },
@@ -853,7 +853,7 @@ const canCreateProject = await authClient.organization.checkRolePermission({
}); });
// You can also check multiple resource permissions at the same time // You can also check multiple resource permissions at the same time
const canCreateProjectAndCreateSale = await authClient.organization.checkRolePermission({ const canCreateProjectAndCreateSale = authClient.organization.checkRolePermission({
permissions: { permissions: {
organization: ["delete"], organization: ["delete"],
member: ["delete"] member: ["delete"]