Created
February 5, 2015 19:40
-
-
Save iraycd/4549c5e871c739c8f4c3 to your computer and use it in GitHub Desktop.
Wheezy Admin Handler
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
from wheezy.web.authorization import authorize | |
from wheezy.web.handlers import BaseHandler | |
class AdminHandler(BaseHandler): | |
@authorize(roles=('admin',)) | |
def __call__(self): | |
method = self.request.method | |
if method == 'GET': | |
return self.get() | |
elif method == 'POST': | |
return self.post() | |
elif method == 'PUT': | |
return self.put() | |
elif method == 'DELETE': | |
return self.delete() | |
return method_not_allowed() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment