Created
February 5, 2015 14:44
-
-
Save Chadtech/d2e480ea4d6e9cfaac61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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