diff --git a/packages/core/src/hierarchy.ts b/packages/core/src/hierarchy.ts index d827addcf0..b667458f88 100644 --- a/packages/core/src/hierarchy.ts +++ b/packages/core/src/hierarchy.ts @@ -289,7 +289,12 @@ export class Hierarchy { let cl: Ref> | undefined = _class while (cl !== undefined) { if (cl === from) return true - cl = this.getClass(cl).extends + + const cll = this.classifiers.get(cl) + if (cll === undefined || this.isInterface(cll)) { + return false + } + cl = (cll as Class).extends } return false } diff --git a/server/front/src/index.ts b/server/front/src/index.ts index ae22c736f3..6fc27b46cd 100644 --- a/server/front/src/index.ts +++ b/server/front/src/index.ts @@ -19,7 +19,7 @@ import { MinioService } from '@hcengineering/minio' import { Token, decodeToken } from '@hcengineering/server-token' import bp from 'body-parser' import cors from 'cors' -import express, { Response } from 'express' +import express, { Request, Response } from 'express' import fileUpload, { UploadedFile } from 'express-fileupload' import expressStaticGzip from 'express-static-gzip' import https from 'https' @@ -314,7 +314,7 @@ export function start ( }) ) - async function handleHead (ctx: MeasureContext, req: any, res: Response): Promise { + async function handleHead (ctx: MeasureContext, req: Request, res: Response): Promise { try { const token = req.query.token as string const payload = decodeToken(token) @@ -370,7 +370,7 @@ export function start ( ) }) - const filesHandler = async (ctx: MeasureContext, req: any, res: Response): Promise => { + const filesHandler = async (ctx: MeasureContext, req: Request, res: Response): Promise => { try { const cookies = ((req?.headers?.cookie as string) ?? '').split(';').map((it) => it.trim().split('=')) @@ -487,8 +487,7 @@ export function start ( ) }) - // eslint-disable-next-line @typescript-eslint/no-misused-promises - app.delete('/files', async (req, res) => { + const handleDelete = async (req: Request, res: Response): Promise => { try { const authHeader = req.headers.authorization if (authHeader === undefined) { @@ -520,7 +519,13 @@ export function start ( console.log(error) res.status(500).send() } - }) + } + + // eslint-disable-next-line @typescript-eslint/no-misused-promises + app.delete('/files', handleDelete) + + // eslint-disable-next-line @typescript-eslint/no-misused-promises + app.delete('/files/*', handleDelete) // todo remove it after update all customers chrome extensions app.get('/import', (req, res) => { diff --git a/server/front/src/utils.ts b/server/front/src/utils.ts index ff2821e4de..0f0473081e 100644 --- a/server/front/src/utils.ts +++ b/server/front/src/utils.ts @@ -1,3 +1,5 @@ +import { Request } from 'express' + export const ETagSupport = { isWeak (etag: string): boolean { return etag.startsWith('W/"')