diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index 171af4764b..d255670a52 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -39,6 +39,7 @@ function parseIntWithDefault(val, def) { const BannedUser = React.createClass({ propTypes: { + canUnban: React.PropTypes.bool, member: React.PropTypes.object.isRequired, // js-sdk RoomMember reason: React.PropTypes.string, }, @@ -67,13 +68,17 @@ const BannedUser = React.createClass({ }, render: function() { + let unbanButton; + + if (this.props.canUnban) { + unbanButton = + { _t('Unban') } + ; + } + return (
  • - - { _t('Unban') } - + { unbanButton } {this.props.member.name} {this.props.member.userId} {this.props.reason ? " " +_t('Reason') + ": " + this.props.reason : ""}
  • @@ -667,6 +672,7 @@ module.exports = React.createClass({ const banned = this.props.room.getMembersWithMembership("ban"); let bannedUsersSection; if (banned.length) { + const canBanUsers = current_user_level >= ban_level; bannedUsersSection =

    { _t('Banned users') }

    @@ -674,7 +680,7 @@ module.exports = React.createClass({ {banned.map(function(member) { const banEvent = member.events.member.getContent(); return ( - + ); })}