mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-23 13:46:11 +00:00
fix: acl check for subdomain on access
This commit is contained in:
@@ -147,6 +147,14 @@ class PuterSiteMiddleware extends AdvancedBase {
|
||||
res.status(502).send('subdomain is pointing to non-directory');
|
||||
}
|
||||
|
||||
// Verify subdomain owner permission
|
||||
const subdomain_actor = Actor.adapt(subdomain_owner);
|
||||
const svc_acl = services.get('acl');
|
||||
if ( ! await svc_acl.check(subdomain_actor, node, 'read') ) {
|
||||
res.status(502).send('subdomain owner does not have access to directory');
|
||||
return;
|
||||
}
|
||||
|
||||
subdomain_root_path = await node.get('path');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user