Skip to content

Commit 2386d87

Browse files
committed
feat: add writable attribute to fs items
1 parent fc26f88 commit 2386d87

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backend/src/filesystem/FSNodeContext.js

+8
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,13 @@ module.exports = class FSNodeContext {
659659
await this.fetchEntry();
660660
return this.isRoot;
661661
}
662+
663+
if ( key === 'writable' ) {
664+
const actor = Context.get('actor');
665+
if ( !actor || !actor.type.user ) return undefined;
666+
const svc_acl = this.services.get('acl');
667+
return await svc_acl.check(actor, this, 'write');
668+
}
662669

663670
throw new Error(`unrecognize key for FSNodeContext.get: ${key}`);
664671
}
@@ -789,6 +796,7 @@ module.exports = class FSNodeContext {
789796

790797
fsentry.dirname = _path.dirname(fsentry.path);
791798
fsentry.dirpath = fsentry.dirname;
799+
fsentry.writable = await this.get('writable');
792800

793801
// Do not send internal IDs to clients
794802
fsentry.id = res.uuid;

0 commit comments

Comments
 (0)