mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-08 12:27:44 +00:00
docs: remove unnecessary await in permission checks (#2859)
This commit is contained in:
@@ -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.
|
||||
|
||||
```ts title="auth-client.ts"
|
||||
const canCreateProject = await authClient.organization.checkRolePermission({
|
||||
const canCreateProject = authClient.organization.checkRolePermission({
|
||||
permissions: {
|
||||
organization: ["delete"],
|
||||
},
|
||||
@@ -853,7 +853,7 @@ const canCreateProject = await authClient.organization.checkRolePermission({
|
||||
});
|
||||
|
||||
// You can also check multiple resource permissions at the same time
|
||||
const canCreateProjectAndCreateSale = await authClient.organization.checkRolePermission({
|
||||
const canCreateProjectAndCreateSale = authClient.organization.checkRolePermission({
|
||||
permissions: {
|
||||
organization: ["delete"],
|
||||
member: ["delete"]
|
||||
|
||||
Reference in New Issue
Block a user