diff options
author | Thuan Pham Quoc <thuanpq.io@gmail.com> | 2017-12-01 15:55:53 +0700 |
---|---|---|
committer | Thuan Pham Quoc <thuanpq.io@gmail.com> | 2017-12-01 15:55:53 +0700 |
commit | 22e369804b2a6ed82a6da2c469519cd7252693a0 (patch) | |
tree | a48d4a60683dc0419147accd3041230f8b4d1a2a /models/users.js | |
parent | 54036fd7a3ac9bf25b6c601890491af66571d5ff (diff) | |
download | wekan-22e369804b2a6ed82a6da2c469519cd7252693a0.tar.gz wekan-22e369804b2a6ed82a6da2c469519cd7252693a0.tar.bz2 wekan-22e369804b2a6ed82a6da2c469519cd7252693a0.zip |
Allow admin to change user password in admin panel
Diffstat (limited to 'models/users.js')
-rw-r--r-- | models/users.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/models/users.js b/models/users.js index 11a53ce6..92cee9f6 100644 --- a/models/users.js +++ b/models/users.js @@ -372,6 +372,13 @@ Meteor.methods({ Meteor.call('setUsername', username, userId); Meteor.call('setEmail', email, userId); }, + setPassword(newPassword, userId) { + check(userId, String); + check(newPassword, String); + if(Meteor.user().isAdmin){ + Accounts.setPassword(userId, newPassword); + } + }, }); if (Meteor.isServer) { |