Add admin 'assume user' button

This commit is contained in:
Chris Blanchard 2015-09-26 12:15:24 +01:00
parent 1c0f001e4a
commit f8557bb073

View file

@ -226,3 +226,27 @@ var CurrentUser = React.createClass({
}
});
var AssumeUserIdButton = React.createClass({
assumeId(e) {
e.preventDefault();
if (this.props.gatherer) {
socket.emit("users:authorize", {
id: this.props.gatherer.id
});
// Refresh Gather list
setTimeout(() => {
socket.emit("gather:refresh");
}, 5000);
}
},
render() {
let currentUser = this.props.currentUser;
let gatherer = this.props.gatherer;
if (currentUser && gatherer) {
return <button
className="btn btn-xs btn-danger"
onClick={this.assumeId}>Assume User ID</button>
}
}
});