Example #1
0
def authz_lists(action):
    if action == 'read' and request.authz_lists.get('read') is None:
        request.authz_lists['read'] = List.user_list_ids(current_user)
    if action == 'write' and request.authz_lists.get('write') is None:
        request.authz_lists['write'] = List.user_list_ids(current_user,
            include_public=False) # noqa
    return request.authz_lists[action] or []
Example #2
0
def authz_lists(action):
    if action == 'read' and request.authz_lists.get('read') is None:
        request.authz_lists['read'] = List.user_list_ids(current_user)
    if action == 'write' and request.authz_lists.get('write') is None:
        request.authz_lists['write'] = List.user_list_ids(
            current_user, include_public=False)  # noqa
    return request.authz_lists[action] or []
Example #3
0
def index():
    list_ids = List.user_list_ids(current_user)
    filter_lists = request.args.getlist("list")
    if len(filter_lists):
        try:
            filter_lists = [int(f) for f in filter_lists]
            list_ids = [l for l in list_ids if l in filter_lists]
        except ValueError:
            raise BadRequest()

    prefix = request.args.get("prefix")
    q = Entity.by_lists(list_ids, prefix=prefix)
    return jsonify(Pager(q))
Example #4
0
def index():
    list_ids = List.user_list_ids(current_user)
    filter_lists = request.args.getlist('list')
    if len(filter_lists):
        try:
            filter_lists = [int(f) for f in filter_lists]
            list_ids = [l for l in list_ids if l in filter_lists]
        except ValueError:
            raise BadRequest()

    prefix = request.args.get('prefix')
    q = Entity.by_lists(list_ids, prefix=prefix)
    return jsonify(Pager(q))