Exemple #1
0
 def POST(self, path):
     p = db.get_version(path)
     if not p:
         raise web.seeother(path)
         
     i = web.input('permission.key', 'child_permission.key')
     q = {
         'key': path,
         'permission': {
             'connect': 'update',
             'key': i['permission.key'] or None,
         },
         'child_permission': {
             'connect': 'update',
             'key': i['child_permission.key'] or None,
         }
     }
     
     try:
         web.ctx.site.write(q)
     except Exception, e:
         import traceback
         traceback.print_exc(e)
         add_flash_message('error', str(e))
         return render.permission(p)
Exemple #2
0
    def POST(self, path):
        p = db.get_version(path)
        if not p:
            raise web.seeother(path)

        i = web.input('permission.key', 'child_permission.key')
        q = {
            'key': path,
            'permission': {
                'connect': 'update',
                'key': i['permission.key'] or None,
            },
            'child_permission': {
                'connect': 'update',
                'key': i['child_permission.key'] or None,
            },
        }

        try:
            web.ctx.site.write(q)
        except Exception as e:
            import traceback

            traceback.print_exc(e)
            add_flash_message('error', str(e))
            return render.permission(p)

        raise web.seeother(web.changequery({}, m='permission'))
Exemple #3
0
 def GET(self, path):
     p = db.get_version(path)
     if not p:
         raise web.seeother(path)
     return render.permission(p)
Exemple #4
0
 def GET(self, path):
     p = db.get_version(path)
     if not p:
         raise web.seeother(path)
     return render.permission(p)