Wrong information for organization has permission endpoint in docs #775

Closed
opened 2026-03-13 08:03:48 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @dotamir on GitHub (Mar 4, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

As the documentation mentions, to check if a user has permission in an organization, we need to do this:

auth.api.organizationHasPermission({
        headers: await headers(),
        body: {
            permission: {
                project: ["create"] // This must match the structure in your access control
            }
        }
    });

But organizationHasPermission is not available in api and it returns error. I have checked the code and the correct one is auth.api.hasPermission to check permissions in organizations and auth.api.userHasPermission for admin pluing.

Current vs. Expected behavior

Documentation must be fixed, and the correct function name must be mentioned.

What version of Better Auth are you using?

1.2.2

Provide environment information

- OS: MacOS

Which area(s) are affected? (Select all that apply)

Documentation

Auth config (if applicable)


Additional context

No response

Originally created by @dotamir on GitHub (Mar 4, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce As the documentation mentions, to check if a user has permission in an organization, we need to do this: ```js auth.api.organizationHasPermission({ headers: await headers(), body: { permission: { project: ["create"] // This must match the structure in your access control } } }); ``` But `organizationHasPermission` is not available in `api` and it returns error. I have checked the code and the correct one is `auth.api.hasPermission` to check permissions in organizations and `auth.api.userHasPermission` for admin pluing. ### Current vs. Expected behavior Documentation must be fixed, and the correct function name must be mentioned. ### What version of Better Auth are you using? 1.2.2 ### Provide environment information ```bash - OS: MacOS ``` ### Which area(s) are affected? (Select all that apply) Documentation ### Auth config (if applicable) ```typescript ``` ### Additional context _No response_
GiteaMirror added the bug label 2026-03-13 08:03:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#775