Skip to content

Commit d128cee

Browse files
committed
fix: handle subpaths under another user
1 parent 19a5eb0 commit d128cee

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/backend/src/filesystem/FSNodeContext.js

+11
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,17 @@ module.exports = class FSNodeContext {
162162
if ( this.found === false ) return undefined;
163163
return ! this.entry.parent_uid;
164164
}
165+
166+
async getUserPart () {
167+
if ( this.isRoot ) return;
168+
169+
let path = await this.get('path');
170+
if ( path.startsWith('/') ) path = path.slice(1);
171+
const components = path.split('/');
172+
const userpart = components[0];
173+
174+
return userpart;
175+
}
165176

166177
async exists (fetch_options = {}) {
167178
await this.fetchEntry();

packages/backend/src/filesystem/hl_operations/hl_readdir.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ class HLReadDir extends HLFilesystemOperation {
5353
const ll_listusers = new LLListUsers();
5454
children = await ll_listusers.run(this.values);
5555
} else if (
56-
await subject.isUserDirectory() &&
57-
await subject.get('name') !== user.username
56+
await subject.getUserPart() !== user.username
5857
) {
5958
this.log.noticeme('THIS HAPPEN');
6059
const ll_readshares = new LLReadShares();

0 commit comments

Comments
 (0)