Does anyone have a good example of how authClient.admin.hasPermission works?
I've tried everything, searching, using AI, but nothing makes it work in my code. How should this be used correctly? Could some good soul give me an example of a complete configuration + example of use?
Solution:Jump to solution
You can't force cast 
as BetterAuthOptions as that will break inference in your auth config.6 Replies
This simply checks if the provided user based on the user-id contains those set of permissions, this was copied from our docs: (but modified a little to make easier to understand)
Is the docs missing something for you?
I can only use it like this on the server, besides that I always have these typescript errors, are they normal?
"better-auth": "1.3"
typescript 5.9.2
@Max

Can you show me your auth config?
Solution
You can't force cast 
as BetterAuthOptions as that will break inference in your auth config.Ohhh, that was really it. Thank you! 🥰