fix: fix no perm
This commit is contained in:
parent
a8ad8e37d4
commit
5d32e2dca5
1 changed files with 1 additions and 1 deletions
|
|
@ -381,7 +381,7 @@ export class UserController extends Controller {
|
|||
const THROW_PERM_MSG = "You do not have permission to perform this action.";
|
||||
const THROW_PERM_CODE = "noPermission";
|
||||
|
||||
if (setRoleIndex < userRoleIndex) {
|
||||
if (setRoleIndex !== -1 && setRoleIndex < userRoleIndex) {
|
||||
throw new HttpError(HttpStatus.FORBIDDEN, THROW_PERM_MSG, THROW_PERM_CODE);
|
||||
}
|
||||
if (!globalAllow(req.user)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue