don't show promote option for presenter user'

This commit is contained in:
Anton Georgiev 2017-02-01 14:44:05 -05:00
parent 1ad5cc1959
commit 3857d932b6

View File

@ -113,18 +113,16 @@ class UserListItem extends Component {
unmute, unmute,
} = userActions; } = userActions;
const hasAuthority = currentUser.isModerator || user.isCurrent;
let allowedToChatPrivately = !user.isCurrent; let allowedToChatPrivately = !user.isCurrent;
let allowedToMuteAudio = (currentUser.isModerator || user.isCurrent) && user.isVoiceUser && user.isMuted; let allowedToMuteAudio = hasAuthority && user.isVoiceUser && user.isMuted;
let allowedToUnmuteAudio = (currentUser.isModerator || user.isCurrent) && user.isVoiceUser && !user.isMuted; let allowedToUnmuteAudio = hasAuthority && user.isVoiceUser && !user.isMuted;
let allowedToResetStatus = hasAuthority;
// if currentUser is a moderator or user is currently logged in,
// can clear status from the userlist.
let allowedToResetStatus = !!(currentUser.isModerator || user.isCurrent);
// if currentUser is a moderator, allow kicking other users // if currentUser is a moderator, allow kicking other users
let allowedToKick = currentUser.isModerator && !user.isCurrent; let allowedToKick = currentUser.isModerator && !user.isCurrent;
let allowedToSetPresenter = currentUser.isModerator || currentUser.isPresenter; let allowedToSetPresenter = (currentUser.isModerator || currentUser.isPresenter) && !user.isPresenter;
return _.compact([ return _.compact([
(allowedToChatPrivately ? this.renderUserAction(openChat, router, user) : null), (allowedToChatPrivately ? this.renderUserAction(openChat, router, user) : null),