作者:jiajiajy323 | 来源:互联网 | 2023-09-15 15:28
Ihaveacollectionhookononecollectiontospawnanemptycalendar.Thisismoreorlessabase
I have a collection hook on one collection to spawn an "empty calendar". This is more or less a base that needs to be maintained unchanged, that is to say, deny updates.
我在一个集合上有一个集合钩子,以产生一个“空日历”。这或多或少是一个需要保持不变的基础,也就是说,拒绝更新。
Players.after.insert({
// creates an empty calendar
Calendars.insert({
playerId: this._id
});
});
On most calendars, update would be perfectly okay, but on these specific calendars which are inserted via this hook, I want to deny updates.
在大多数日历中,更新将完全没问题,但是在通过此挂钩插入的这些特定日历中,我想拒绝更新。
Calendars.deny({
update: function (userId, doc) {
// don't allow "blank" calendar to be updated
}
});
What is the secure way to manage denying updates of a subset of documents in a collection with meteor?
使用meteor管理拒绝集合中文档子集更新的安全方法是什么?
1 个解决方案