mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
fix: handle subpaths under another user
This commit is contained in:
parent
19a5eb0076
commit
d128ceed6f
@ -163,6 +163,17 @@ module.exports = class FSNodeContext {
|
||||
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();
|
||||
if ( ! this.found ) {
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user