Add admin ability : Impersonate one user.

This commit is contained in:
Guillaume 2020-09-16 18:11:19 +00:00
parent 8f6c3550e3
commit d19cc972e0
5 changed files with 859 additions and 821 deletions

View file

@ -194,6 +194,7 @@ BlazeComponent.extendComponent({
return [
{
'click a.edit-user': Popup.open('editUser'),
'click a.more-settings-user': Popup.open('settingsUser'),
},
];
},
@ -343,3 +344,16 @@ Template.newUserPopup.events({
Popup.close();
},
});
Template.settingsUserPopup.events({
'click .impersonate-user'(event) {
event.preventDefault();
Meteor.call('impersonate', this.userId, err => {
if (!err) {
FlowRouter.go('/');
Meteor.connection.setUserId(this.userId);
}
});
},
});