fix(admin): require adminRoles option for a role to be considered an admin role

This commit is contained in:
Bereket Engida
2025-03-04 09:51:32 +03:00
parent 685145101a
commit 31c974a744
3 changed files with 46 additions and 2 deletions

View File

@@ -514,6 +514,20 @@ admin({
defaultRole: "regular",
});
```
### Admin Roles
The roles that are considered admin roles. Defaults to `["admin"]`.
```ts title="auth.ts"
admin({
adminRoles: ["admin", "superadmin"],
});
```
<Callout type="warning">
Any role that isn't in the `adminRoles` list, even if they have the permission,
will not be considered an admin.
</Callout>
### Admin userIds
@@ -525,6 +539,8 @@ admin({
})
```
If a user is in the `adminUserIds` list, they will be able to perform any admin operation.
### impersonationSessionDuration
The duration of the impersonation session in seconds. Defaults to 1 hour.