* infrastructure for authkit
* menu generation code * improved templates * database and basic role setup in websetup.py
This commit is contained in:
parent
096df406b8
commit
55124e861f
20 changed files with 431 additions and 68 deletions
22
gnuviechadminweb/controllers/login.py
Normal file
22
gnuviechadminweb/controllers/login.py
Normal 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')
|
13
gnuviechadminweb/controllers/menu.py
Normal file
13
gnuviechadminweb/controllers/menu.py
Normal 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')
|
Loading…
Add table
Add a link
Reference in a new issue