Esempio n. 1
0
def jsonify_user(obj):
    """Convert user to JSON."""
    result = jsonify_sqlobject(obj)
    del result['password']
    result["groups"] = [g.group_name for g in obj.groups]
    result["permissions"] = [p.permission_name for p in obj.permissions]
    return result
Esempio n. 2
0
def jsonify_user(obj):
    """Convert user to JSON."""
    result = jsonify_sqlobject(obj)
    del result['password']
    result["groups"] = [g.group_name for g in obj.groups]
    result["permissions"] = [p.permission_name for p in obj.permissions]
    return result
Esempio n. 3
0
def jsonify_user(obj):
    result = jsonify_sqlobject(obj)
    try: del result['password']
    except KeyError: pass
    result["groups"] = [g.group_name for g in obj.groups]
    result["permissions"] = [p.permission_name for p in obj.permissions]
    return result
Esempio n. 4
0
def jsonify_permission(obj):
    result = jsonify_sqlobject(obj)
    result["groups"] = [g.group_name for g in obj.groups]
    return result
Esempio n. 5
0
def jsonify_group(obj):
    result = jsonify_sqlobject(obj)
    result["users"] = [u.user_name for u in obj.users]
    result["permissions"] = [p.permission_name for p in obj.permissions]
    return result
Esempio n. 6
0
def jsonify_permission(obj):
    result = jsonify_sqlobject(obj)
    result["groups"] = [g.group_name for g in obj.groups]
    return result
Esempio n. 7
0
def jsonify_user(obj):
    result = jsonify_sqlobject(obj)
    del result["password"]
    result["groups"] = [g.group_name for g in obj.groups]
    result["permissions"] = [p.permission_name for p in obj.permissions]
    return result
Esempio n. 8
0
def jsonify_group(obj):
    result = jsonify_sqlobject(obj)
    result["users"] = [u.user_name for u in obj.users]
    result["permissions"] = [p.permission_name for p in obj.permissions]
    return result
Esempio n. 9
0
def jsonify_permission(obj):
    """Convert permissions to JSON."""
    result = jsonify_sqlobject(obj)
    result["groups"] = [g.group_name for g in obj.groups]
    return result
Esempio n. 10
0
def jsonify_listitem(obj):
    return jsonify_sqlobject(obj.child)
Esempio n. 11
0
def jsonify_item(obj):
    result = jsonify_sqlobject(obj)
    result["children"] = [jsonify_item(li.child) for li in obj.children]
    return result
Esempio n. 12
0
def jsonify_permission(obj):
    """Convert permissions to JSON."""
    result = jsonify_sqlobject(obj)
    result["groups"] = [g.group_name for g in obj.groups]
    return result
def jsonify_user(obj):
    result = jsonify_sqlobject(obj)
    result.pop('password', None)
    result['groups'] = [g.group_name for g in obj.groups]
    result['permissions'] = [p.permission_name for p in obj.permissions]
    return result