ui: update graphiql

This commit is contained in:
undefined committed 2022-11-17 23:48:37 +08:00
1 parent bebeb1b201
commit c4dced87ff
12 files changed
+41 -298

No files matched your search

+5 -5
View File
@@ -12,11 +12,11 @@
},
"preferUnplugged": true,
"dependencies": {
"@aws-sdk/client-s3": "^3.210.0",
"@aws-sdk/lib-storage": "^3.210.0",
"@aws-sdk/middleware-endpoint": "^3.208.0",
"@aws-sdk/s3-presigned-post": "^3.210.0",
"@aws-sdk/s3-request-presigner": "^3.210.0",
"@aws-sdk/client-s3": "^3.212.0",
"@aws-sdk/lib-storage": "^3.212.0",
"@aws-sdk/middleware-endpoint": "^3.212.0",
"@aws-sdk/s3-presigned-post": "^3.212.0",
"@aws-sdk/s3-request-presigner": "^3.212.0",
"@graphql-tools/schema": "^8.5.1",
"@hydrooj/utils": "workspace:*",
"adm-zip": "0.5.5",
+2 -1
View File
@@ -3,7 +3,7 @@ import { statSync } from 'fs';
import { pick } from 'lodash';
import { lookup } from 'mime-types';
import {
BadRequestError, ForbiddenError, ValidationError,
BadRequestError, ForbiddenError, NotFoundError, ValidationError,
} from '../error';
import { PRIV } from '../model/builtin';
import * as oplog from '../model/oplog';
@@ -96,6 +96,7 @@ export class FSDownloadHandler extends Handler {
@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 ForbiddenError('Access denied');
this.response.addHeader('Cache-Control', 'public');
const target = `user/${uid}/${filename}`;