diff options
-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; } |