Permalink
Browse files

Add support for making REST requests against the development env

  • Loading branch information...
1 parent b1a0f1d commit d5fec72935a57af95ec7828868319de900f6f635 @kyleconroy kyleconroy committed Jan 30, 2012
Showing with 7 additions and 1 deletion.
  1. +1 −1 stashboard/app.yaml
  2. +6 −0 stashboard/utils/authorized.py
View
@@ -62,4 +62,4 @@ skip_files: |
(.*\.markdown)|
(license\.txt)|
(setup.py)
- )$
+ )$
@@ -39,14 +39,20 @@ def api(role):
A decorator to enforce user roles in context of the API
"""
def wrapper(handler_method):
+
def check_login(self, *args, **kwargs):
+ dev = os.environ['SERVER_SOFTWARE'].startswith('Development')
host = self.request.headers.get('host', 'nohost')
try:
user = oauth.get_current_user()
admin = oauth.is_current_user_admin()
except oauth.OAuthRequestError, e:
+ logging.error("OAuthRegistrationError")
admin = False
+ if dev and str(user) == "example@example.com":
+ admin = True
+
if not admin:
user = users.get_current_user()
admin = users.is_current_user_admin()

0 comments on commit d5fec72

Please sign in to comment.