docs: refine Admin Roles wording clarification with code snippet comment

This commit is contained in:
Anjellyrika
2026-02-20 10:54:18 +08:00
parent f20ae0bcbf
commit d3fd7123d8

View File

@@ -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