This commit is contained in:
undefined committed 2021-05-11 23:40:52 +08:00
1 parent 29965f323b
commit 8ea50bfafb
2 files changed
+6 -11

No files matched your search

+1 -6
View File
@@ -5,7 +5,7 @@ import {
} from 'mongodb';
import {
Pdoc, Ddoc, Drdoc, Tdoc, TrainingDoc,
ProblemStatusDoc, User, Content,
ProblemStatusDoc, Content,
} from '../interface';
import { buildProjection } from '../utils';
import { NumberKeys, ArrayKeys, Projection, MaybeArray } from '../typeutils';
@@ -44,11 +44,6 @@ export interface DocStatusType {
[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']>(
domainId: string, content: Content, owner: number,
docType: T, docId: K,