Exemplo n.º 1
0
def admin():
    user = current_user()
    is_admin = is_administrator(user)
    log('Is admin?', is_admin)
    if is_admin:
        option_json = request.json
        Channel.update_roles(option_json)
        response_data = cid_rid_for_cookie()
        return json.dumps(response_data, indent=2)
    else:
        abort(401)
Exemplo n.º 2
0
def admin():
    option_json = request.get_json()
    Channel.update_roles(option_json)
    response_data = cid_rid_for_cookie()
    return json.dumps(response_data, indent=2)