Skip to content

Commit

Permalink
Fix condition to ask for old password
Browse files Browse the repository at this point in the history
Refs #1885
  • Loading branch information
Edmundo Alvarez committed Mar 17, 2016
1 parent 061132d commit 4729683
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion graylog2-web-interface/src/components/users/UserForm.jsx
Expand Up @@ -113,7 +113,12 @@ const UserForm = React.createClass({

const user = this.props.user;
const permissions = this.state.currentUser.permissions;
const requiresOldPassword = !this.isPermitted(permissions, 'users:passwordchange:*');

let requiresOldPassword = true;
if (this.isPermitted(permissions, 'users:passwordchange:*')) {
// Ask for old password if user is editing their own account
requiresOldPassword = this.props.user.username === this.state.currentUser.username;
}

const streamReadOptions = this.formatSelectedOptions(this.props.user.permissions, 'streams:read', this.state.streams);
const streamEditOptions = this.formatSelectedOptions(this.props.user.permissions, 'streams:edit', this.state.streams);
Expand Down

0 comments on commit 4729683

Please sign in to comment.