mirror of
https://github.com/wekan/wekan.git
synced 2025-04-20 12:07:11 -04:00
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
This commit is contained in:
commit
b242f49d7c
2 changed files with 18 additions and 1 deletions
13
CHANGELOG.md
13
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:
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue