fix(api): allow server owner to delete other admin accounts

pull/1413/head
sct 3 years ago
parent 2a869f74eb
commit 2ac6fe7f6d
No known key found for this signature in database
GPG Key ID: 77D146606D30DCCD

@ -281,7 +281,7 @@ router.delete<{ id: string }>(
});
}
if (user.hasPermission(Permission.ADMIN)) {
if (user.hasPermission(Permission.ADMIN) && req.user?.id !== 1) {
return next({
status: 405,
message: 'You cannot delete users with administrative privileges.',

Loading…
Cancel
Save