2016-09-27 69 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

相關問題