diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-04-02 17:44:04 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-04-02 17:44:04 +0300 |
commit | b242f49d7c2b26fb2bb25006b652151bd3e4c5e0 (patch) | |
tree | c2695ed565759a16df49dc399233f75c46cd7cd9 | |
parent | c42c81b60ac1848dcfb2edac5b6fd9d800b27490 (diff) | |
parent | 11bf182b5025d5727e58b7f408561f63f5cb1dac (diff) | |
download | wekan-b242f49d7c2b26fb2bb25006b652151bd3e4c5e0.tar.gz wekan-b242f49d7c2b26fb2bb25006b652151bd3e4c5e0.tar.bz2 wekan-b242f49d7c2b26fb2bb25006b652151bd3e4c5e0.zip |
Merge branch 'Zokormazo-admin' into devel
Set first user as admin, it there is no existing
users and Wekan is not running at Sandstorm.
Fixes #924
-rw-r--r-- | CHANGELOG.md | 13 | ||||
-rw-r--r-- | models/users.js | 6 |
2 files changed, 18 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b0eb3c71..2d5ab210 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +# Upcoming Wekan release + +Known bugs: + +* https://github.com/wekan/wekan/issues/784 + +This release adds the following new features: + +* Set first user as admin, it there is no existing + users and Wekan is not running at Sandstorm. + +Thanks to GitHub user Zokormazo for contributions. + # v0.18 2017-04-02 Wekan release Known bugs: diff --git a/models/users.js b/models/users.js index 7b484f92..236feb45 100644 --- a/models/users.js +++ b/models/users.js @@ -104,6 +104,10 @@ Users.attachSchema(new SimpleSchema({ type: Date, optional: true, }, + isAdmin: { + type: Boolean, + optional: true + } })); // Search a user in the complete server database by its name or username. This @@ -405,7 +409,7 @@ if (Meteor.isServer) { }); Accounts.onCreateUser((options, user) => { const userCount = Users.find().count(); - if (userCount === 0){ + if (!isSandstorm && userCount === 0 ){ user.isAdmin = true; return user; } |