config.add_route("login", "/login")
config.add_view(login, route_name="login", check_csrf=True, renderer="json")
- #config.add_route("merge", "/merge")
- #config.add_view(merge, route_name="merge", renderer="merge.mako")
+ config.add_route("merge", "/admin/merge")
+ config.add_view(merge, route_name="merge", renderer="merge.mako", permission="merge")
return config.make_wsgi_app()
# default ACL
class ACLFactory(object):
__acl__ = [
+ # permission, principal, permission
(Allow, Everyone, 'view'),
- (Allow, 'group:admins', 'merge')
+ (Allow, 'admin', 'merge')
]
def __init__(self, request):
pass
player_email = DBSession.query(Player).\
filter(Player.email_addr == persona_email).one()
- #log.debug("Verified email address: %s" % persona_email)
- #log.debug("Corresponding player is %s" % player_email)
+ log.debug("Verified email address: %s" % persona_email)
+ log.debug("Corresponding player is %s" % player_email)
if player_email is not None:
# Add the headers required to remember the user to the response
# Return a json message containing the address or path to redirect to.
return {'redirect': request.POST['came_from'], 'success': True}
+
+def merge(request):
+ '''A simple merge view. The merge.mako template does the work.'''
+ return {}