FedericoCeratto/bottle-cork — pull request #14 by 23min (2012-10-03 21:56:41+00:00)
Title: Decorator v1

The decorator is done. I've added a bunch of new tests as well.

Now you can do:

@bottle.route('/admin')
@authorize(role="admin", fail_redirect='/sorry_page')
@bottle.view('admin_page')
def admin():
"""Only admin users can see this"""
#aaa.require(role='admin', fail_redirect='/sorry_page')
return dict(
current_user = aaa.current_user,
users = aaa.list_users(),
roles = aaa.list_roles()
)