mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
fix
This commit is contained in:
1 parent
29965f323b
commit
8ea50bfafb
1 file changed
+1
-6
@@ -5,7 +5,7 @@ import {
|
|||||||
} from 'mongodb';
|
} from 'mongodb';
|
||||||
import {
|
import {
|
||||||
Pdoc, Ddoc, Drdoc, Tdoc, TrainingDoc,
|
Pdoc, Ddoc, Drdoc, Tdoc, TrainingDoc,
|
||||||
ProblemStatusDoc, User, Content,
|
ProblemStatusDoc, Content,
|
||||||
} from '../interface';
|
} from '../interface';
|
||||||
import { buildProjection } from '../utils';
|
import { buildProjection } from '../utils';
|
||||||
import { NumberKeys, ArrayKeys, Projection, MaybeArray } from '../typeutils';
|
import { NumberKeys, ArrayKeys, Projection, MaybeArray } from '../typeutils';
|
||||||
@@ -44,11 +44,6 @@ export interface DocStatusType {
|
|||||||
[key: number]: any
|
[key: number]: any
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function canView<T extends keyof DocType>(doc: DocType[T], user: User): Promise<boolean> {
|
|
||||||
if (doc.owner === user._id || doc.maintainers.includes(user._id) || doc.participants.includes(user._id)) return true;
|
|
||||||
if ()
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function add<T extends keyof DocType, K extends DocType[T]['docId']>(
|
export async function add<T extends keyof DocType, K extends DocType[T]['docId']>(
|
||||||
domainId: string, content: Content, owner: number,
|
domainId: string, content: Content, owner: number,
|
||||||
docType: T, docId: K,
|
docType: T, docId: K,
|
||||||
|
|||||||
Reference in new issue
Block a user