mirror of
https://github.com/wekan/wekan.git
synced 2026-01-31 05:35:16 +01:00
Add message from service administrator
This commit is contained in:
parent
eb945f26a3
commit
aa1876f94c
10 changed files with 135 additions and 4 deletions
36
models/notices.js
Normal file
36
models/notices.js
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
Notices = new Mongo.Collection('notices');
|
||||
|
||||
Notices.attachSchema(new SimpleSchema({
|
||||
enabled: {
|
||||
type: Boolean,
|
||||
defaultValue: false,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
body: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
sort: {
|
||||
type: Number,
|
||||
decimal: true,
|
||||
},
|
||||
}));
|
||||
|
||||
Notices.allow({
|
||||
update(userId) {
|
||||
const user = Users.findOne(userId);
|
||||
return user && user.isAdmin;
|
||||
},
|
||||
});
|
||||
|
||||
if (Meteor.isServer) {
|
||||
Meteor.startup(() => {
|
||||
const notices = Notices.findOne({});
|
||||
if(!notices){
|
||||
Notices.insert({enabled: false, sort: 0});
|
||||
}
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue