Skip to content

Instantly share code, notes, and snippets.

@mikeifomin
Created March 26, 2016 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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