mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: add force join using admin privileges
This commit is contained in:
4 files changed
+106
-138
No files matched your search
@@ -173,11 +173,14 @@ class DomainUserHandler extends ManageHandler {
|
||||
@requireSudo
|
||||
@param('uids', Types.NumericArray)
|
||||
@param('role', Types.Role)
|
||||
async postSetUsers(domainId: string, uid: number[], role: string) {
|
||||
@param('join', Types.Boolean)
|
||||
async postSetUsers(domainId: string, uid: number[], role: string, join = false) {
|
||||
if (join) this.checkPriv(PRIV.PRIV_MANAGE_ALL_DOMAIN);
|
||||
await Promise.all([
|
||||
domain.setUserRole(domainId, uid, role),
|
||||
oplog.log(this, 'domain.setRole', { uid, role }),
|
||||
oplog.log(this, 'domain.setRole', { uid, role, join }),
|
||||
]);
|
||||
if (join) await domain.setJoin(domainId, uid, true);
|
||||
this.back();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user