2013-02-02 4 views

ответ

1

Вы можете использовать Meteor.methods. Просто не забудьте включить их только на сервер, поместив код в папку с именем server/.

server/admin.js

Meteor.methods({ 
    foo: function (arg1, arg2) { 
    // confirm that the user is an admin 
    if (! this.user.isAdmin) 
     throw new Meteor.Error(401, "You are not authorized to perform this action"); 
    // perform task 
    return "some return value"; 
    } 
}); 
Смежные вопросы