core: restore PERM_EDIT_PROBLEM_SELF

This commit is contained in:
undefined committed 2021-05-08 22:44:04 +08:00
1 parent 5b0478fb3f
commit 866aa56f78
11 files changed
+25 -21

No files matched your search

+3 -2
View File
@@ -87,8 +87,9 @@ class User implements _User {
return this;
}
own<T extends { owner: number, maintainer?: number[] }>(doc: T, exact = false) {
return exact
own(doc: any, arg1: any = false): boolean {
if (typeof arg1 === 'bigint' && !this.hasPerm(arg1)) return false;
return (typeof arg1 === 'boolean' && arg1)
? doc.owner === this._id
: doc.owner === this._id || (doc.maintainer || []).includes(this._id);
}