Created
November 26, 2012 21:30
-
-
Save chadwhitacre/4150750 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
# === configure-aspen.py === | |
website.security.timeout = 86400 | |
website.security.httpbasic.enabled = True | |
website.security.httpdigest.enabled = True | |
website.security.cookieauth.enabled = True | |
website.security.cookieauth.timeout = 86400 * 7 | |
# === login / logout === | |
if credentials_valid: | |
website.security.grant_session(username) | |
if logout_button_pressed: | |
website.security.logout(username) | |
# === authorization option: declarative === | |
roles_allowed = ('admin', 'user') | |
^L | |
^L | |
# === authorization option: user object === | |
^L | |
if user.ANON: | |
raise Response(404) | |
^L |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment