mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
fix(frontend): Do not allow user w/ ID 1 to disable 'Admin' permission (#965)
This commit is contained in:
@@ -266,6 +266,13 @@ userSettingsRoutes.post<
|
||||
return next({ status: 404, message: 'User not found.' });
|
||||
}
|
||||
|
||||
if (user.id === 1) {
|
||||
return next({
|
||||
status: 500,
|
||||
message: 'Permissions for user with ID 1 cannot be modified',
|
||||
});
|
||||
}
|
||||
|
||||
user.permissions = req.body.permissions;
|
||||
|
||||
await userRepository.save(user);
|
||||
|
Reference in New Issue
Block a user