mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix share
This commit is contained in:
1 parent
5c3b13be82
commit
c116d6a212
4 files changed
+18
-20
No files matched your search
@@ -187,6 +187,8 @@ export class ProblemMainHandler extends ProblemHandler {
|
||||
@param('pids', Types.NumericArray)
|
||||
@param('target', Types.String)
|
||||
async postCopy(domainId: string, pids: number[], target: string) {
|
||||
const t = `,${this.domain.share || ''},`;
|
||||
if (t !== ',*,' && !t.includes(`,${target},`)) throw new PermissionError(target);
|
||||
const ddoc = await domain.get(target);
|
||||
if (!ddoc) throw new NotFoundError(target);
|
||||
const dudoc = await user.getById(target, this.user._id);
|
||||
@@ -346,6 +348,8 @@ export class ProblemDetailHandler extends ProblemHandler {
|
||||
|
||||
@param('target', Types.String)
|
||||
async postCopy(domainId: string, target: string) {
|
||||
const t = `,${this.domain.share || ''},`;
|
||||
if (t !== ',*,' && !t.includes(`,${target},`)) throw new PermissionError(target);
|
||||
const ddoc = await domain.get(target);
|
||||
if (!ddoc) throw new NotFoundError(target);
|
||||
const dudoc = await user.getById(target, this.user._id);
|
||||
|
||||
Reference in new issue
Block a user