From 04c05a5bb8b73dda21093a2bf563f5cd6faaa356 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Fri, 27 Sep 2024 15:44:06 -0400 Subject: [PATCH] fix: properly add owner object to fsentries --- src/backend/src/filesystem/FSNodeContext.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/backend/src/filesystem/FSNodeContext.js b/src/backend/src/filesystem/FSNodeContext.js index 219a193435..48e3112aee 100644 --- a/src/backend/src/filesystem/FSNodeContext.js +++ b/src/backend/src/filesystem/FSNodeContext.js @@ -777,6 +777,16 @@ module.exports = class FSNodeContext { fsentry[k] = res[k]; } + let actor; try { + actor = Context.get('actor'); + } catch (e) {} + if ( ! actor?.type?.user || actor.type.user.id !== res.user_id ) { + if ( ! fsentry.owner ) await this.fetchOwner(); + fsentry.owner = { + username: res.owner?.username, + }; + } + const info = this.services.get('information'); if ( ! this.uid && ! this.entry.uuid ) {