Daniel Tan
Daniel Tan
Explore posts from servers
BABetter Auth
Created by Daniel Tan on 4/24/2025 in #help
got 403 in while list users
so i fixed it by created custom permissions like this
import { createAccessControl } from "better-auth/plugins/access";
import { adminAc, defaultStatements } from "better-auth/plugins/admin/access";

/**
* make sure to use `as const` so typescript can infer the type correctly
*/
const statement = {
...defaultStatements,
} as const;

export const ac = createAccessControl(statement);

export const karyawan = ac.newRole({
});

export const manager = ac.newRole({
...adminAc.statements,
});

export const admin = ac.newRole({
...adminAc.statements,
});
import { createAccessControl } from "better-auth/plugins/access";
import { adminAc, defaultStatements } from "better-auth/plugins/admin/access";

/**
* make sure to use `as const` so typescript can infer the type correctly
*/
const statement = {
...defaultStatements,
} as const;

export const ac = createAccessControl(statement);

export const karyawan = ac.newRole({
});

export const manager = ac.newRole({
...adminAc.statements,
});

export const admin = ac.newRole({
...adminAc.statements,
});
then just imported on my auth.ts and authClient.ts file idk why on adminRoles is not working
4 replies
DDokploy
Created by Daniel Tan on 8/16/2024 in #old-help
access dokploy service on localhost with WSL2
Finally, it's working! Thanks
6 replies