mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 13:07:17 -04:00
39 lines
745 B
JavaScript
39 lines
745 B
JavaScript
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,
|
|
},
|
|
});
|
|
AccountSettings.upsert({_id: 'accounts-allowUserNameChange'}, {
|
|
$setOnInsert: {
|
|
booleanValue: false,
|
|
sort: 1,
|
|
},
|
|
});
|
|
});
|
|
}
|