mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core&ui: fix defaultPriv edit (#444)
Co-authored-by: undefined <i@undefined.moe>
This commit is contained in:
1 parent
e964eec099
commit
a230d1c7c3
5 files changed
+39
-38
No files matched your search
@@ -286,10 +286,11 @@ class SystemUserPrivHandler extends SystemHandler {
|
||||
}
|
||||
|
||||
@requireSudo
|
||||
@param('uid', Types.Int, true)
|
||||
@param('uid', Types.Int)
|
||||
@param('priv', Types.UnsignedInt)
|
||||
async post(domainId: string, uid: number, priv: number) {
|
||||
if (typeof uid === 'number') {
|
||||
@param('system', Types.Boolean, true)
|
||||
async post(domainId: string, uid: number, priv: number, editSystem: boolean) {
|
||||
if (!editSystem) {
|
||||
const udoc = await user.getById(domainId, uid);
|
||||
if (!udoc) throw new UserNotFoundError(uid);
|
||||
if (udoc.priv === -1 || priv === -1 || priv === allPriv) throw new ForbiddenError('you can not edit user as SU in web.');
|
||||
|
||||
Reference in new issue
Block a user