File tree 1 file changed +21
-0
lines changed
packages/backend/src/routers
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -427,6 +427,12 @@ const v0_2 = async (req, res) => {
427
427
: { id : { name : thing . name } }
428
428
} ) ;
429
429
}
430
+
431
+ app . metadata = db . case ( {
432
+ mysql : ( ) => app . metadata ,
433
+ otherwise : ( ) => JSON . parse ( app . metadata ?? '{}' )
434
+ } ) ( ) ;
435
+
430
436
item . app = app ;
431
437
}
432
438
@@ -451,6 +457,21 @@ const v0_2 = async (req, res) => {
451
457
)
452
458
}
453
459
460
+ // Process: conditionally add permission for AppData
461
+ for ( const item of shares_work . list ( ) ) {
462
+ if ( item . type !== 'app' ) continue ;
463
+ if ( ! item . app . metadata ?. shared_appdata ) continue ;
464
+
465
+ const app_owner = await get_user ( { id : item . app . owner_user_id } ) ;
466
+
467
+ const appdatadir =
468
+ `/${ app_owner . username } /AppData/${ item . app . uid } ` ;
469
+ const appdatadir_perm =
470
+ PermissionUtil . join ( 'fs' , appdatadir , 'write' ) ;
471
+
472
+ item . share_intent . permissions . push ( appdatadir_perm ) ;
473
+ }
474
+
454
475
shares_work . clear_invalid ( ) ;
455
476
456
477
// Mark files as successful; further errors will be
You can’t perform that action at this time.
0 commit comments