@@ -374,12 +374,12 @@ foam.CLASS({
374374 themeIcon : 'edit' ,
375375 icon : 'images/edit-icon.svg' ,
376376 size : 'SMALL' ,
377- internalIsEnabled : function ( config , data ) {
377+ internalIsEnabled : async function ( config , data ) {
378378 if ( config . CRUDEnabledActionsAuth && config . CRUDEnabledActionsAuth . isEnabled ) {
379379 try {
380380 let permissionString = config . CRUDEnabledActionsAuth . enabledActionsAuth . permissionFactory ( foam . core . dao . Operation . UPDATE , data ) ;
381381
382- return this . auth ?. check ( null , permissionString ) && this . data ;
382+ return ( await this . auth ?. check ( null , permissionString ) ) && this . data ;
383383 } catch ( e ) {
384384 return false ;
385385 }
@@ -402,12 +402,12 @@ foam.CLASS({
402402 class : 'foam.comics.v3.ComicsAction' ,
403403 name : 'copy' ,
404404 size : 'SMALL' ,
405- internalIsEnabled : function ( config , data ) {
405+ internalIsEnabled : async function ( config , data ) {
406406 if ( config . CRUDEnabledActionsAuth && config . CRUDEnabledActionsAuth . isEnabled ) {
407407 try {
408408 let permissionString = config . CRUDEnabledActionsAuth . enabledActionsAuth . permissionFactory ( foam . core . dao . Operation . CREATE , data ) ;
409409
410- return this . auth ?. check ( null , permissionString ) ;
410+ return await this . auth ?. check ( null , permissionString ) ;
411411 } catch ( e ) {
412412 return false ;
413413 }
@@ -516,12 +516,12 @@ foam.CLASS({
516516 class : 'foam.comics.v3.ComicsAction' ,
517517 name : 'delete' ,
518518 size : 'SMALL' ,
519- internalIsEnabled : function ( config , data ) {
519+ internalIsEnabled : async function ( config , data ) {
520520 if ( config . CRUDEnabledActionsAuth && config . CRUDEnabledActionsAuth . isEnabled ) {
521521 try {
522522 let permissionString = config . CRUDEnabledActionsAuth . enabledActionsAuth . permissionFactory ( foam . core . dao . Operation . REMOVE , data ) ;
523523
524- return this . auth ?. check ( null , permissionString ) ;
524+ return await this . auth ?. check ( null , permissionString ) ;
525525 } catch ( e ) {
526526 return false ;
527527 }
0 commit comments