mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-25 16:36:34 -05:00
docs: refine Admin Roles wording clarification with code snippet comment
This commit is contained in:
@@ -754,12 +754,11 @@ admin({
|
||||
```
|
||||
### Admin Roles
|
||||
|
||||
Specifies which of the built-in roles (`admin` and `user`) are considered admin roles. Defaults to `["admin"]`.
|
||||
|
||||
**Note**: Custom roles require using custom access control with the `ac` and `roles` options. Without custom access control, you can only use the built-in `admin` and `user` roles.
|
||||
Specifies which roles are considered admin roles. Defaults to `["admin"]`. Custom roles (for example, `superadmin`) must be defined in custom access control.
|
||||
|
||||
```ts title="auth.ts"
|
||||
admin({
|
||||
// Requires custom access control with `superadmin` defined in `roles`
|
||||
adminRoles: ["admin", "superadmin"],
|
||||
});
|
||||
```
|
||||
@@ -767,8 +766,9 @@ admin({
|
||||
<Callout type="warning">
|
||||
**Note:** The `adminRoles` option is **not required** when using custom access control (via `ac` and `roles`). When you define custom roles with specific permissions, those roles will have exactly the permissions you grant them through the access control system.
|
||||
|
||||
**Warning:** When **not** using custom access control, any role that isn't in the `adminRoles` list will **not** be able to perform admin operations.
|
||||
|
||||
**Warning:** When **not** using custom access control, only `admin` and `user` exist as valid roles. Any role that isn't in the `adminRoles` list will **not** be able to perform admin operations.
|
||||
|
||||
</Callout>
|
||||
|
||||
### Admin userIds
|
||||
|
||||
Reference in New Issue
Block a user