Skip to content

Commit d011327

Browse files
authored
Change banned check from role to status
Updated the condition to check user status instead of role for banning.
1 parent 5feae21 commit d011327

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adminforth/documentation/docs/tutorial/03-Customization/12-security.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export const admin = new AdminForth({
223223
auth: {
224224
adminUserAuthorize: [
225225
async ({adminUser, adminforth, extra}) => {
226-
if (adminUser.dbUser.role === 'banned') {
226+
if (adminUser.dbUser.status === 'banned') {
227227
return { allowed: false, error: "User is banned" };
228228
}
229229
return { allowed: true };
@@ -236,4 +236,4 @@ export const admin = new AdminForth({
236236

237237
```
238238
239-
Now, if a user’s role is changed to "banned", they won’t be able to perform any actions and will be automatically logged out upon accessing the page.
239+
Now, if a user’s field "status" is changed to "banned", they won’t be able to perform any actions and will be automatically logged out upon accessing the page.

0 commit comments

Comments
 (0)