Skip to content

Instantly share code, notes, and snippets.

@jonathanKingston
Forked from mikebannister/gist:2552208
Created April 29, 2012 17:57
Show Gist options
  • Save jonathanKingston/2552266 to your computer and use it in GitHub Desktop.
Save jonathanKingston/2552266 to your computer and use it in GitHub Desktop.
function post(args) {
//DO post here
}
function comment() {
//Do comment here
}
function checkUser(args) {
//Check args here to make sue is user
if(user = Users.find({user: args.username}) && user.password == hash(args.salt+args.password)) {
return true;
} else {
return false;
//Other function won't run if this returns false
}
}
Meteor.methods({
post: post,
comment: comment
});
Meteor.methods.beforeFilter(checkUser, {only: ['post']});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment