Dynamic Access Control hasPermission is always false
Hi guys, I am very likely doing something wrong, but I've been looking everywhere for a little more information and can't really find anything.
I have enabled the organizatoin plugin and the dynamic access control, and have been able to successfully create a role.
The role is in the database, it looks good, i assigned it to a user, and that also looks good. But whatever call I make from that users session, checking for a permission always returns false.
Simplified Example:
role: readonly
permissions: {
"configuration": [
"read"
]
}
await auth.api.hasPermission({
headers: h,
body: { permissions: { configuration: ["read"] } },
});
--> { error: null, success: false }
I have enabled the organizatoin plugin and the dynamic access control, and have been able to successfully create a role.
The role is in the database, it looks good, i assigned it to a user, and that also looks good. But whatever call I make from that users session, checking for a permission always returns false.
Simplified Example:
role: readonly
permissions: {
"configuration": [
"read"
]
}
await auth.api.hasPermission({
headers: h,
body: { permissions: { configuration: ["read"] } },
});
--> { error: null, success: false }