mirror of
https://github.com/sct/overseerr.git
synced 2025-09-26 20:12:33 +02:00
fix: do not allow editing of user settings under certain conditions (#1168)
* fix: do not allow editing of user settings under certain conditions * feat(lang): generate translation keys for new strings * refactor: modify owner check for clarity * fix(ui): hide buttons where appropriate and add missing translation string
This commit is contained in:
@@ -559,6 +559,7 @@ const UserList: React.FC = () => {
|
||||
<Table.TD alignText="right">
|
||||
<Button
|
||||
buttonType="warning"
|
||||
disabled={user.id === 1 && currentUser?.id !== 1}
|
||||
className="mr-2"
|
||||
onClick={() =>
|
||||
router.push(
|
||||
@@ -571,7 +572,11 @@ const UserList: React.FC = () => {
|
||||
</Button>
|
||||
<Button
|
||||
buttonType="danger"
|
||||
disabled={hasPermission(Permission.ADMIN, user.permissions)}
|
||||
disabled={
|
||||
user.id === 1 ||
|
||||
(currentUser?.id !== 1 &&
|
||||
hasPermission(Permission.ADMIN, user.permissions))
|
||||
}
|
||||
onClick={() => setDeleteModal({ isOpen: true, user })}
|
||||
>
|
||||
{intl.formatMessage(messages.delete)}
|
||||
|
Reference in New Issue
Block a user