Skip to content

Instantly share code, notes, and snippets.

@Chadtech
Created February 5, 2015 14:44
Show Gist options
  • Save Chadtech/d2e480ea4d6e9cfaac61 to your computer and use it in GitHub Desktop.
Save Chadtech/d2e480ea4d6e9cfaac61 to your computer and use it in GitHub Desktop.
authenticated = authentication user
homePage() unless authenticated
switch user.role
when 'Admin'
AdminPage user, authenticated
when 'Mod'
ModPage user, authenticated
else
userPage user, authenticated
################################
################################
authenticated = authentication user
homePage() unless authenticated
if user.role is 'Admin'
AdminPage user, authenticated
else if user.role is 'Mod'
ModPage user, authenticated
else
userPage user, authenticated
################################
################################
if not (authentication user)
homePage()
else
if user.role is 'Admin'
AdminPage user, (authentication user)
else if user.role is 'Mod'
ModPage user, (authentication user)
else
userPage user, (authentication user)
################################
################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment