Access Control - hasPermission always success false
Hi everyone, I have a question about Better Auth regarding the Access Control system in the Organization plugin.
I noticed that there are two types of ACL:
In the documentation, there’s a hasPermission method that should check whether a user has certain permissions within an organization. However, whenever I call it, I always get this response:
{ error: null, success: false }
success is always false, with no logs or explanation.
The documentation doesn’t clarify whether this method works only with the dynamic ACL or if it should also work with the static ACL.
I ended up writing my own custom permission-checking method, but I’d really like to understand the best practices here, since the documentation isn’t very clear.
I noticed that there are two types of ACL:
- the static ACL, where roles are defined directly in the code, and
- the dynamic ACL, where roles and permissions are managed at the database level.
In the documentation, there’s a hasPermission method that should check whether a user has certain permissions within an organization. However, whenever I call it, I always get this response:
{ error: null, success: false }
success is always false, with no logs or explanation.
The documentation doesn’t clarify whether this method works only with the dynamic ACL or if it should also work with the static ACL.
I ended up writing my own custom permission-checking method, but I’d really like to understand the best practices here, since the documentation isn’t very clear.