RBAC

i need someone xplain me why this not works
import { createAccessControl } from "better-auth/plugins/access";
import { defaultStatements, adminAc } from "better-auth/plugins/admin/access";

const statement = {
...defaultStatements,

} as const;

export const ac = createAccessControl(statement);

export const superadmin = ac.newRole({

...adminAc.statements,
})


export const roles = {
superadmin
};
import { createAccessControl } from "better-auth/plugins/access";
import { defaultStatements, adminAc } from "better-auth/plugins/admin/access";

const statement = {
...defaultStatements,

} as const;

export const ac = createAccessControl(statement);

export const superadmin = ac.newRole({

...adminAc.statements,
})


export const roles = {
superadmin
};
this shoud create a role superadmin with same auth as admin ryt when i use
authClient.admin.createUser
authClient.admin.createUser
i am geting
No description
5 Replies
Ashborn013H
Ashborn013HOP3w ago
Yep
Ashborn013H
Ashborn013HOP3w ago
After you create the custom admin role you have set it as admin by passing it in the auth.ts file
Ashborn013H
Ashborn013HOP3w ago
No description

Did you find this page helpful?