diff --git a/packages/backend/src/filesystem/FSNodeContext.js b/packages/backend/src/filesystem/FSNodeContext.js index daf1a9e4..a53ea06d 100644 --- a/packages/backend/src/filesystem/FSNodeContext.js +++ b/packages/backend/src/filesystem/FSNodeContext.js @@ -162,6 +162,17 @@ module.exports = class FSNodeContext { if ( this.found === false ) return undefined; return ! this.entry.parent_uid; } + + async getUserPart () { + if ( this.isRoot ) return; + + let path = await this.get('path'); + if ( path.startsWith('/') ) path = path.slice(1); + const components = path.split('/'); + const userpart = components[0]; + + return userpart; + } async exists (fetch_options = {}) { await this.fetchEntry(); diff --git a/packages/backend/src/filesystem/hl_operations/hl_readdir.js b/packages/backend/src/filesystem/hl_operations/hl_readdir.js index 73e1d5fc..96a6858f 100644 --- a/packages/backend/src/filesystem/hl_operations/hl_readdir.js +++ b/packages/backend/src/filesystem/hl_operations/hl_readdir.js @@ -53,8 +53,7 @@ class HLReadDir extends HLFilesystemOperation { const ll_listusers = new LLListUsers(); children = await ll_listusers.run(this.values); } else if ( - await subject.isUserDirectory() && - await subject.get('name') !== user.username + await subject.getUserPart() !== user.username ) { this.log.noticeme('THIS HAPPEN'); const ll_readshares = new LLReadShares();