Skip to content

Commit

Permalink
fix: avoid disable permissions of super users, closes #3318
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Jan 8, 2025
1 parent 7a33676 commit 96f46f6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions phpmyfaq/admin/assets/src/user/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const setUserData = async (userId) => {
element.setAttribute('disabled', '');
});
document.getElementById('checkAll').setAttribute('disabled', '');
document.getElementById('uncheckAll').setAttribute('disabled', '');
} else {
const superAdmin = document.getElementById('is_superadmin');
superAdmin.removeAttribute('checked');
Expand Down Expand Up @@ -149,14 +150,16 @@ export const handleUsers = async () => {
element.setAttribute('disabled', '');
});
document.getElementById('checkAll').setAttribute('disabled', '');
document.getElementById('uncheckAll').setAttribute('disabled', '');
} else {
document.querySelectorAll('.permission').forEach((checkbox) => {
checkbox.removeAttribute('disabled');
});
document.querySelectorAll('#pmf-user-rights-save').forEach((element) => {
element.removeAttribute('disabled', '');
element.removeAttribute('disabled');
});
document.getElementById('checkAll').removeAttribute('disabled', '');
document.getElementById('checkAll').removeAttribute('disabled');
document.getElementById('uncheckAll').removeAttribute('disabled');
}
});
}
Expand Down

0 comments on commit 96f46f6

Please sign in to comment.