Skip to content

Commit 85fc125

Browse files
authored
Update 12-security.md
1 parent 8b0858a commit 85fc125

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
@@ -185,7 +185,7 @@ Let's consider example:
185185
//diff-add
186186
all: false,
187187
//diff-add
188-
list: (user :AdminUser) => user.dbUser.role === 'superadmin',
188+
list: ({ adminUser }: { adminUser: AdminUser }) => adminUser.dbUser.role === 'superadmin',
189189
},
190190
}
191191
```
@@ -200,7 +200,7 @@ So to completely hide the email field from all users apart superadmins, you shou
200200
name: 'email',
201201
type: AdminForthDataTypes.STRING,
202202
//diff-add
203-
backendOnly: (user: AdminUser) => user.dbUser.role !== 'superadmin',
203+
backendOnly: ({ adminUser }: { adminUser: AdminUser }) => adminUser.dbUser.role === 'superadmin',
204204
showIn: {
205205
all: false,
206206
list: (user: AdminUser) => user.dbUser.role === 'superadmin',

0 commit comments

Comments
 (0)