0
我想通過服務器上的方法爲登錄用戶(使用alanning:roles包)設置角色。這是我有...流星alanning:角色 - 錯誤調用方法'updateRoles':內部服務器錯誤[500]
客戶
var userId = Meteor.userId();
Meteor.call('updateRoles',userId,'admin');
這是method from the docs的簡化版本...
服務器/ userMethods.js
Meteor.methods({
updateRoles: function (targetUserId, roles) {
Roles.setUserRoles(targetUserId, roles)
}
})
無論我嘗試什麼,我都會收到以下錯誤...
Error invoking Method 'updateRoles': Internal server error [500]
注意使用方法任何用戶都可以將自己設爲管理員。 –
是的,我知道,我簡化了問題的方法,因爲我確定問題與省略的代碼無關。我將從文檔中使用相同的方法。 – Serks