Skip to content

Instantly share code, notes, and snippets.

@mikeifomin
Created March 26, 2016 21:23
Show Gist options
  • Save mikeifomin/6631fa2b45867a303f07 to your computer and use it in GitHub Desktop.
Save mikeifomin/6631fa2b45867a303f07 to your computer and use it in GitHub Desktop.
.coffee
Router.onBeforeAction ->
userId = Meteor.userId()
if @route?.options?.roles
if Roles.userIsInRole userId,@route.options.roles
@next()
else
@render("pageAccessDenied")
else if @route?.options?.authRequire
if userId
@next()
else
@render("pageAccessDenied")
else
@next()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment