Skip to content

Commit

Permalink
Fix option to change role to user for super admins (#4818)
Browse files Browse the repository at this point in the history
* Fix option to change role to user for super admins

* Clean up permission check
  • Loading branch information
FestiveKyle authored Sep 26, 2023
1 parent e7ff471 commit c15b1d1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontend/src/admin/UserListModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,8 @@ export function UserListModal({
>
{editingUserRole === 'PENDING' && <option value="PENDING">{t`PENDING`}</option>}
{(['PENDING', 'USER'].includes(editingUserRole) ||
(['ADMIN', 'OWNER', 'SUPER_ADMIN'].includes(permission) && editingUserRole === 'ADMIN')) && (
<option value="USER">{t`USER`}</option>
)}
(['ADMIN', 'OWNER'].includes(permission) && editingUserRole === 'ADMIN') ||
permission === 'SUPER_ADMIN') && <option value="USER">{t`USER`}</option>}
{(['PENDING', 'USER', 'ADMIN'].includes(editingUserRole) ||
(['SUPER_ADMIN'].includes(permission) && editingUserRole === 'OWNER')) && (
<option value="ADMIN">{t`ADMIN`}</option>
Expand Down

0 comments on commit c15b1d1

Please sign in to comment.