diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-04-02 17:36:48 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-04-02 17:36:48 +0300 |
commit | dd40bcf2333a07857725ba8c3fd31a57bd6b8ca3 (patch) | |
tree | 3b9b0323fdb510949435ef96aa3e5a1d2113c4fe | |
parent | c42c81b60ac1848dcfb2edac5b6fd9d800b27490 (diff) | |
parent | 28a1dd677c19d319148168a15f423721c8b95ed6 (diff) | |
download | wekan-dd40bcf2333a07857725ba8c3fd31a57bd6b8ca3.tar.gz wekan-dd40bcf2333a07857725ba8c3fd31a57bd6b8ca3.tar.bz2 wekan-dd40bcf2333a07857725ba8c3fd31a57bd6b8ca3.zip |
Merge branch 'admin' of https://github.com/Zokormazo/wekan into Zokormazo-admin
Add Feature: Set admin on first run
Fixes #924
-rw-r--r-- | models/users.js | 6 |
1 files changed, 5 insertions, 1 deletions
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; } |