浏览代码

fix: properly add owner object to fsentries

KernelDeimos 7 月之前
父节点
当前提交
04c05a5bb8
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      src/backend/src/filesystem/FSNodeContext.js

+ 10 - 0
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 ) {