Dr.Pepper
Dr.Pepper
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
For everyone wondering about the issue from authClient.organization.inviteMember the temp fix is todo something like:
await authClient.organization.hasPermission({
permission: { crewInvite: ["view"] } as any,
});
await authClient.organization.hasPermission({
permission: { crewInvite: ["view"] } as any,
});
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
Nvm the hasPermission still doesn't work however the issue's in the auth.ts config have been fixed
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
Correct this issue is fixed, you might also want to take a look into authClient.organization.inviteMember Type 'string' is not assignable to type '"member" | "admin" | "owner"'.ts(2322) it does not allow for a custom role at:
type InferRolesFromOption<O extends OrganizationOptions | undefined> = O extends {
roles: any;
} ? keyof O["roles"] : "admin" | "member" | "owner";
type InferRolesFromOption<O extends OrganizationOptions | undefined> = O extends {
roles: any;
} ? keyof O["roles"] : "admin" | "member" | "owner";
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
Thanks, np thank you for all the amazing work better-auth really changed the development speed by alot! especially for someone working alone on a huge project.
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
No description
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
No description
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
so:
authClient.organization.hasPermission
authClient.organization.hasPermission
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
on the client
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
Reverting to 1.1.19 fixed it from 1.2.0 and up it does not work
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
Ima try to revert to a older version and see if it works
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
Also it's not only local its local and on the production server
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
this is the list of packages
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
├── @heroui/[email protected]
├── @heroui/[email protected]
├── @heroui/[email protected]
├── @iconify/[email protected]
├── @prisma/[email protected]
├── @radix-ui/[email protected]
├── @radix-ui/[email protected]
├── @radix-ui/[email protected]
├── @radix-ui/[email protected]
├── @react-email/[email protected]
├── @reactuses/[email protected]
├── @tailwindcss/[email protected]
├── @tanstack/[email protected]
├── @tanstack/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @vercel/[email protected]
├── @heroui/[email protected]
├── @heroui/[email protected]
├── @heroui/[email protected]
├── @iconify/[email protected]
├── @prisma/[email protected]
├── @radix-ui/[email protected]
├── @radix-ui/[email protected]
├── @radix-ui/[email protected]
├── @radix-ui/[email protected]
├── @react-email/[email protected]
├── @reactuses/[email protected]
├── @tailwindcss/[email protected]
├── @tanstack/[email protected]
├── @tanstack/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @vercel/[email protected]
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
the standard (invitation,team) etc works but my crewInventory still gives:
Object literal may only specify known properties, and 'crewInventory' does not exist in type '{ readonly organization?: ("update" | "delete")[] | undefined; readonly member?: ("update" | "delete" | "create")[] | undefined; readonly invitation?: ("create" | "cancel")[] | undefined; readonly team?: ("update" | ... 1 more ... | "create")[] | undefined; }'.ts(2353)
better-auth.Dxn5Xplu.d.ts(6555, 21): The expected type comes from property 'permission' which is declared here on type 'Prettify<{ permission: { readonly organization?: ("update" | "delete")[] | undefined; readonly member?: ("update" | "delete" | "create")[] | undefined; readonly invitation?: ("create" | "cancel")[] | undefined; readonly team?: ("update" | ... 1 more ... | "create")[] | undefined; }; organizationId?: string | undefin...'
Object literal may only specify known properties, and 'crewInventory' does not exist in type '{ readonly organization?: ("update" | "delete")[] | undefined; readonly member?: ("update" | "delete" | "create")[] | undefined; readonly invitation?: ("create" | "cancel")[] | undefined; readonly team?: ("update" | ... 1 more ... | "create")[] | undefined; }'.ts(2353)
better-auth.Dxn5Xplu.d.ts(6555, 21): The expected type comes from property 'permission' which is declared here on type 'Prettify<{ permission: { readonly organization?: ("update" | "delete")[] | undefined; readonly member?: ("update" | "delete" | "create")[] | undefined; readonly invitation?: ("create" | "cancel")[] | undefined; readonly team?: ("update" | ... 1 more ... | "create")[] | undefined; }; organizationId?: string | undefin...'
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
However the custom permission still seems to error after loading
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
That was indeed the issue for some reason it reffered to a global installed better-auth even though i don't remember globally installing it thanks!
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
Alright let me try that
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
No description
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
admin: {
statements: statements,
authorize(request, connector) {

},
}
admin: {
statements: statements,
authorize(request, connector) {

},
}
37 replies
BABetter Auth
Created by Dr.Pepper on 3/5/2025 in #help
Custom Permissions Not Working
now requires something like
37 replies