mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
29 lines
601 B
JavaScript
29 lines
601 B
JavaScript
import { Meteor } from 'meteor/meteor';
|
|
|
|
Actions = new Mongo.Collection('actions');
|
|
|
|
Actions.allow({
|
|
insert(userId, doc) {
|
|
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
|
},
|
|
update(userId, doc) {
|
|
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
|
},
|
|
remove(userId, doc) {
|
|
return allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
|
},
|
|
});
|
|
|
|
Actions.helpers({
|
|
description() {
|
|
return this.desc;
|
|
},
|
|
});
|
|
|
|
if (Meteor.isServer) {
|
|
Meteor.startup(() => {
|
|
Actions._collection._ensureIndex({ modifiedAt: -1 });
|
|
});
|
|
}
|
|
|
|
export default Actions;
|