2016-09-27 73 views
-1

我需要帮助,不允许访问者在流星应用程序的浏览器控制台中增加他们的分数。

Meteor.users.update({_。ID:Meteor.userId()},{$组:

目前 “黑客” 可以通过在控制台输入此增加他的场均得分{“profile.score “:1000000}})

+0

提问之前请仔细阅读流星的文档。您要查找的是允许/拒绝规则(http://docs.meteor.com/api/collections.html#Mongo-Collection-allow)。 –

回答

0

删除'不安全'和'autopublish'软件包,Khai说。 并添加

Meteor.users.allow({ 
    update:function(){ 
     return false; 
    } 
}) 

在服务器端

1

@Vasil Nedyalkov的回答可能是正确的考虑,但我会做到这一点,而不是:

Meteor.users.deny({ 
    insert() { return true; }, 
    update() { return true; }, 
    remove() { return true; }, 
}); 

以及消除insecureautopublish他说的那样。

这是一个很好的解释: https://guide.meteor.com/security.html#allow-deny

相关问题