mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
Merge branch 'Akuket-feature/impersonate-user'
This commit is contained in:
commit
abe291837a
6 changed files with 861 additions and 821 deletions
|
@ -104,6 +104,8 @@ template(name="peopleRow")
|
|||
a.edit-user
|
||||
i.fa.fa-edit
|
||||
| {{_ 'edit'}}
|
||||
a.more-settings-user
|
||||
i.fa.fa-ellipsis-h
|
||||
|
||||
template(name="editUserPopup")
|
||||
form
|
||||
|
@ -200,3 +202,10 @@ template(name="newUserPopup")
|
|||
input.js-profile-password(type="password")
|
||||
div.buttonsContainer
|
||||
input.primary.wide(type="submit" value="{{_ 'save'}}")
|
||||
|
||||
template(name="settingsUserPopup")
|
||||
ul.pop-over-list
|
||||
li
|
||||
a.impersonate-user
|
||||
i.fa.fa-user
|
||||
| {{_ 'impersonate-user'}}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
@ -46,3 +46,6 @@ table
|
|||
|
||||
div
|
||||
margin: auto
|
||||
|
||||
.more-settings-user
|
||||
margin-left: 10px;
|
||||
|
|
1644
i18n/en-GB.i18n.json
1644
i18n/en-GB.i18n.json
File diff suppressed because it is too large
Load diff
|
@ -359,6 +359,7 @@
|
|||
"headerBarCreateBoardPopup-title": "Create Board",
|
||||
"home": "Home",
|
||||
"import": "Import",
|
||||
"impersonate-user": "Impersonate user",
|
||||
"link": "Link",
|
||||
"import-board": "import board",
|
||||
"import-board-c": "Import board",
|
||||
|
@ -403,6 +404,7 @@
|
|||
"list-select-cards": "Select all cards in this list",
|
||||
"set-color-list": "Set Color",
|
||||
"listActionPopup-title": "List Actions",
|
||||
"settingsUserPopup-title": "User Settings",
|
||||
"swimlaneActionPopup-title": "Swimlane Actions",
|
||||
"swimlaneAddPopup-title": "Add a Swimlane below",
|
||||
"listImportCardPopup-title": "Import a Trello card",
|
||||
|
|
|
@ -905,6 +905,16 @@ if (Meteor.isServer) {
|
|||
}
|
||||
return { username: user.username, email: user.emails[0].address };
|
||||
},
|
||||
impersonate(userId) {
|
||||
check(userId, String);
|
||||
|
||||
if (!Meteor.users.findOne(userId))
|
||||
throw new Meteor.Error(404, 'User not found');
|
||||
if (!Meteor.user().isAdmin)
|
||||
throw new Meteor.Error(403, 'Permission denied');
|
||||
|
||||
this.setUserId(userId);
|
||||
},
|
||||
});
|
||||
Accounts.onCreateUser((options, user) => {
|
||||
const userCount = Users.find().count();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue