comparison pylons_app/controllers/repos.py @ 52:25e516447a33

implemented autentication
author marcink
date Thu, 08 Apr 2010 12:00:06 +0200
parents 3ada2f409c1c
children 8fb1abd4178a
comparison
equal deleted inserted replaced
51:a699c0088344 52:25e516447a33
4 from pylons.controllers.util import abort, redirect 4 from pylons.controllers.util import abort, redirect
5 from pylons_app.lib import auth 5 from pylons_app.lib import auth
6 from pylons_app.lib.base import BaseController, render 6 from pylons_app.lib.base import BaseController, render
7 from pylons_app.model import meta 7 from pylons_app.model import meta
8 from pylons_app.model.db import Users, UserLogs 8 from pylons_app.model.db import Users, UserLogs
9 from pylons_app.lib.auth import authenticate
10
9 log = logging.getLogger(__name__) 11 log = logging.getLogger(__name__)
10 12
11 class ReposController(BaseController): 13 class ReposController(BaseController):
12 """REST Controller styled on the Atom Publishing Protocol""" 14 """REST Controller styled on the Atom Publishing Protocol"""
13 # To properly map this controller, ensure your config/routing.py 15 # To properly map this controller, ensure your config/routing.py
14 # file has a resource setup: 16 # file has a resource setup:
15 # map.resource('repo', 'repos') 17 # map.resource('repo', 'repos')
18
19 @authenticate
16 def __before__(self): 20 def __before__(self):
17 c.staticurl = g.statics 21 c.staticurl = g.statics
18 c.admin_user = session.get('admin_user') 22 c.admin_user = session.get('admin_user')
19 c.admin_username = session.get('admin_username') 23 c.admin_username = session.get('admin_username')
20 self.sa = meta.Session 24 self.sa = meta.Session