mirror of
https://github.com/wekan/wekan.git
synced 2026-02-06 00:21:48 +01:00
Add change email address
Set allow email change in admin panel
This commit is contained in:
parent
57219df16a
commit
6a10257fd7
9 changed files with 153 additions and 4 deletions
33
models/accountSettings.js
Normal file
33
models/accountSettings.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
AccountSettings = new Mongo.Collection('accountSettings');
|
||||
|
||||
AccountSettings.attachSchema(new SimpleSchema({
|
||||
_id: {
|
||||
type: String,
|
||||
},
|
||||
booleanValue: {
|
||||
type: Boolean,
|
||||
optional: true,
|
||||
},
|
||||
sort: {
|
||||
type: Number,
|
||||
decimal: true,
|
||||
},
|
||||
}));
|
||||
|
||||
AccountSettings.allow({
|
||||
update(userId) {
|
||||
const user = Users.findOne(userId);
|
||||
return user && user.isAdmin;
|
||||
},
|
||||
});
|
||||
|
||||
if (Meteor.isServer) {
|
||||
Meteor.startup(() => {
|
||||
AccountSettings.upsert({ _id: 'accounts-allowEmailChange' }, {
|
||||
$setOnInsert: {
|
||||
booleanValue: false,
|
||||
sort: 0,
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue