Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Cherry pick of #23920 on release-7.8 (#12416)
Browse files Browse the repository at this point in the history
* cherry pick for #23920

* cherry pick for #23920
  • Loading branch information
sbishel authored Aug 8, 2023
1 parent 65aaab5 commit 99c0709
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,15 @@ export default class SystemUsersDropdown extends React.PureComponent<Props, Stat

render() {
const {currentUser, user, isLicensed, config} = this.props;

let isDisabled = this.props.isDisabled;
if (!isDisabled) {
// if not already disabled,
// disable if SystemAdmin being edited by non SystemAdmin
// ie, userManager with EditOtherUsers permissions
isDisabled = UserUtils.isSystemAdmin(user.roles) && !UserUtils.isSystemAdmin(currentUser.roles);
}

const isGuest = UserUtils.isGuest(user.roles);
if (!user) {
return <div/>;
Expand Down Expand Up @@ -635,12 +644,14 @@ export default class SystemUsersDropdown extends React.PureComponent<Props, Stat
{demoteToGuestModal}
{createGroupSyncablesMembershipsModal}
<MenuWrapper
isDisabled={this.props.isDisabled}
isDisabled={isDisabled}
>
<div className='text-right'>
<a>
<span>{currentRoles} </span>
<span className='caret'/>
{!isDisabled &&
<span className='caret'/>
}
</a>
{this.renderAccessToken()}
</div>
Expand Down

0 comments on commit 99c0709

Please sign in to comment.