我需要幫助,不允許訪問者在流星應用程序的瀏覽器控制檯中增加他們的分數。
Meteor.users.update({_。ID:Meteor.userId()},{$組:
目前 「黑客」 可以通過在控制檯輸入此增加他的場均得分{「profile.score 「:1000000}})
我需要幫助,不允許訪問者在流星應用程序的瀏覽器控制檯中增加他們的分數。
Meteor.users.update({_。ID:Meteor.userId()},{$組:
目前 「黑客」 可以通過在控制檯輸入此增加他的場均得分{「profile.score 「:1000000}})
您是否刪除了'不安全'和'autopublish'軟件包。請參閱https://www.meteor.com/tutorials/blaze/security-with-methods
刪除'不安全'和'autopublish'軟件包,Khai說。 並添加
Meteor.users.allow({
update:function(){
return false;
}
})
在服務器端
@Vasil Nedyalkov的回答可能是正確的考慮,但我會做到這一點,而不是:
Meteor.users.deny({
insert() { return true; },
update() { return true; },
remove() { return true; },
});
以及消除insecure
和autopublish
他說的那樣。
這是一個很好的解釋: https://guide.meteor.com/security.html#allow-deny
提問之前請仔細閱讀流星的文檔。您要查找的是允許/拒絕規則(http://docs.meteor.com/api/collections.html#Mongo-Collection-allow)。 –