@@ -35,7 +35,7 @@ async function resolveBoolOrFn(
35
35
}
36
36
) : Promise < boolean > {
37
37
if ( typeof val === 'function' ) {
38
- return ! ! ( await ( val as any ) ( ctx ) ) ;
38
+ return ! ! ( await ( val ) ( ctx ) ) ;
39
39
}
40
40
return ! ! val ;
41
41
}
@@ -50,7 +50,7 @@ async function isBackendOnly(
50
50
adminforth : IAdminForth ;
51
51
}
52
52
) : Promise < boolean > {
53
- return await resolveBoolOrFn ( col . backendOnly as BackendOnlyInput , ctx ) ;
53
+ return await resolveBoolOrFn ( col . backendOnly , ctx ) ;
54
54
}
55
55
56
56
async function isShown (
@@ -404,20 +404,18 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
404
404
405
405
// strip all backendOnly fields or not described in adminForth fields from dbUser
406
406
// (when user defines column and does not set backendOnly, we assume it is not backendOnly)
407
- {
408
- const ctx = {
409
- adminUser,
410
- resource : userResource ,
411
- meta : { } ,
412
- source : ActionCheckSource . ShowRequest ,
413
- adminforth : this . adminforth ,
414
- } ;
415
- for ( const key of Object . keys ( adminUser . dbUser ) ) {
416
- const col = userResource . columns . find ( ( c ) => c . name === key ) ;
417
- const bo = col ? await isBackendOnly ( col , ctx ) : true ;
418
- if ( ! col || bo ) {
419
- delete adminUser . dbUser [ key ] ;
420
- }
407
+ const ctx = {
408
+ adminUser,
409
+ resource : userResource ,
410
+ meta : { } ,
411
+ source : ActionCheckSource . ShowRequest ,
412
+ adminforth : this . adminforth ,
413
+ } ;
414
+ for ( const key of Object . keys ( adminUser . dbUser ) ) {
415
+ const col = userResource . columns . find ( ( c ) => c . name === key ) ;
416
+ const bo = col ? await isBackendOnly ( col , ctx ) : true ;
417
+ if ( ! col || bo ) {
418
+ delete adminUser . dbUser [ key ] ;
421
419
}
422
420
}
423
421
0 commit comments