1
0
Fork 0

* infrastructure for authkit

* menu generation code
* improved templates
* database and basic role setup in websetup.py
This commit is contained in:
Jan Dittberner 2008-06-05 16:24:43 +00:00
parent 096df406b8
commit 55124e861f
20 changed files with 431 additions and 68 deletions

View file

@ -0,0 +1,22 @@
import logging
from gnuviechadminweb.lib.base import *
from authkit.permissions import ValidAuthKitUser
from authkit.authorize.pylons_adaptors import authorize
log = logging.getLogger(__name__)
class LoginController(BaseController):
def index(self):
# Return a rendered template
return render('/loginform.mako')
@authorize(ValidAuthKitUser())
def login(self):
c.messages['messages'].append('Successfully logged in.')
return render('/main.mako')
def logout(self):
c.messages['messages'].append('You are logged out.')
return render('/main.mako')

View file

@ -0,0 +1,13 @@
import logging
from gnuviechadminweb.lib.base import *
from authkit.permissions import HasAuthKitRole
from authkit.authorize.pylons_adaptors import authorize
log = logging.getLogger(__name__)
class MenuController(BaseController):
@authorize(HasAuthKitRole(["menuedit"]))
def index(self):
# Return a rendered template
return render('/menuindex.mako')