mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: domainjoin: check domain existance
This commit is contained in:
1 file changed
+2
-1
@@ -5,7 +5,7 @@ import Schema from 'schemastery';
|
||||
import type { Context } from '../context';
|
||||
import {
|
||||
CannotDeleteSystemDomainError, DomainJoinAlreadyMemberError, DomainJoinForbiddenError, ForbiddenError,
|
||||
InvalidJoinInvitationCodeError, OnlyOwnerCanDeleteDomainError, PermissionError, RoleAlreadyExistError, ValidationError,
|
||||
InvalidJoinInvitationCodeError, NotFoundError, OnlyOwnerCanDeleteDomainError, PermissionError, RoleAlreadyExistError, ValidationError,
|
||||
} from '../error';
|
||||
import type { DomainDoc } from '../interface';
|
||||
import avatar from '../lib/avatar';
|
||||
@@ -344,6 +344,7 @@ class DomainJoinHandler extends Handler {
|
||||
domain.get(target),
|
||||
domain.collUser.findOne({ domainId: target, uid: this.user._id }),
|
||||
]);
|
||||
if (!ddoc) throw new NotFoundError(target);
|
||||
const assignedRole = this.user.hasPriv(PRIV.PRIV_MANAGE_ALL_DOMAIN)
|
||||
? 'root'
|
||||
: dudoc?.role || 'default';
|
||||
|
||||
Reference in new issue
Block a user