Super Admin role creation assistance
Hello Team,
I am looking into creating a role based access control system within my app, I would like to have SUPERADMIN, ADMIN, USER level roles and wanted to see how i can add a new role and make use of this system.
auth-client.ts
auth.ts
4 Replies
Also what is the difference between Admin and Organization plugins?
you can create a roles like this along with their resource and actions on the resource
and you can pass them to the the roles options with the admin config like and for checking you can make sure to use checkPermission api from admin plugin -
and you can pass them to the the roles options with the admin config like and for checking you can make sure to use checkPermission api from admin plugin -
The Admin plugin provides user management and role-based access control, while the Organization plugin enables multi-tenant organization management with teams and member permission. and they can also work well together for more advanced usage - for more pls check on the docs - https://www.better-auth.com/docs/plugins/admin
Admin | Better Auth
Admin plugin for Better Auth
Thank you for the help @KiNFiSH any idea how it would be possible to seed an admin user ?