def get_private_layers(ogc_server_ids):
    q = DBSession.query(LayerWMS) \
        .filter(LayerWMS.public.is_(False)) \
        .join(LayerWMS.ogc_server) \
        .filter(OGCServer.id.in_(ogc_server_ids))
    results = q.all()
    DBSession.expunge_all()
    return {r.id: r for r in results}
def get_protected_layers(role_id, ogc_server_ids):
    q = get_protected_layers_query(role_id,
                                   ogc_server_ids,
                                   what=LayerWMS,
                                   version=2)
    results = q.all()
    DBSession.expunge_all()
    return {r.id: r for r in results}
def get_private_layers(ogc_server_ids):
    q = DBSession.query(LayerWMS) \
        .filter(LayerWMS.public.is_(False)) \
        .join(LayerWMS.ogc_server) \
        .filter(OGCServer.id.in_(ogc_server_ids))
    results = q.all()
    DBSession.expunge_all()
    return {r.id: r for r in results}
示例#4
0
def get_protected_layers(request: Request, ogc_server_ids: Iterable[int]) -> Dict[int, DeclarativeMeta]:
    """
    Get the protected layers.

    Private layers but accessible to the user.
    """
    from c2cgeoportal_commons.models import DBSession, main  # pylint: disable=import-outside-toplevel

    q = get_protected_layers_query(request, ogc_server_ids, what=main.LayerWMS)
    results = q.all()
    DBSession.expunge_all()
    return {r.id: r for r in results}
def get_writable_layers(role_id, ogc_server_ids):
    q = get_writable_layers_query(role_id, ogc_server_ids)
    results = q.all()
    DBSession.expunge_all()
    return {r.id: r for r in results}
def get_writable_layers(role_id, ogc_server_ids):
    q = get_writable_layers_query(role_id, ogc_server_ids)
    results = q.all()
    DBSession.expunge_all()
    return {r.id: r for r in results}
def get_protected_layers(role_id, ogc_server_ids):
    q = get_protected_layers_query(role_id, ogc_server_ids, what=LayerWMS, version=2)
    results = q.all()
    DBSession.expunge_all()
    return {r.id: r for r in results}