]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Add basic merge view with admin group membership required.
authorAnt Zucaro <azucaro@gmail.com>
Mon, 16 Jun 2014 01:42:43 +0000 (21:42 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Mon, 16 Jun 2014 01:42:43 +0000 (21:42 -0400)
xonstat/__init__.py
xonstat/security.py
xonstat/views/admin.py

index 29555048da6a01e98fcb0330159385fa59ca71d8..d2ace0ae6e46d0f45d4675473c0257a4b0ed985b 100644 (file)
@@ -173,7 +173,7 @@ def main(global_config, **settings):
     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()
index 47828a4adc6e905b1854bf3b6b950574f2603e60..a92804c7fb594aa142fd8de8b92d49d4c10af50e 100644 (file)
@@ -16,8 +16,9 @@ GROUPS = {
 # default ACL
 class ACLFactory(object):
     __acl__ = [
+        # permission, principal, permission
         (Allow, Everyone, 'view'),
-        (Allow, 'group:admins', 'merge')
+        (Allow, 'admin', 'merge')
     ]
     def __init__(self, request):
         pass
index b8f64866e459fb18e20bd92e2fc189cc34b6f243..a1516bc8b53dce3c6c0b737756942cb445415821 100644 (file)
@@ -18,8 +18,8 @@ def login(request):
     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
@@ -30,3 +30,7 @@ def login(request):
 
     # 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 {}