mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: fsdownload: remove access denied logic
This commit is contained in:
1 file changed
-3
@@ -84,9 +84,6 @@ export class FSDownloadHandler extends Handler {
|
||||
@param('filename', Types.Filename)
|
||||
@param('noDisposition', Types.Boolean)
|
||||
async get(domainId: string, uid: number, filename: string, noDisposition = false) {
|
||||
const targetUser = await user.getById('system', uid);
|
||||
if (!targetUser) throw new NotFoundError(uid);
|
||||
if (this.user._id !== uid && !targetUser.hasPriv(PRIV.PRIV_CREATE_FILE)) throw new AccessDeniedError();
|
||||
this.response.addHeader('Cache-Control', 'public');
|
||||
const target = `user/${uid}/${filename}`;
|
||||
const file = await storage.getMeta(target);
|
||||
|
||||
Reference in new issue
Block a user