Exemplo n.º 1
0
def get_expanded_entity(entity_id):
    if not entity_id:
        return None
    entity = _get_index_entity(entity_id)
    if entity is None:
        return None
    entity.pop("_index", None)
    entity["collection"] = _get_index_collection(entity["collection_id"])
    return entity
Exemplo n.º 2
0
def get_index_collection(collection_id, action=Authz.READ):
    collection = obj_or_404(_get_index_collection(collection_id))
    require(request.authz.can(collection['id'], action))
    return collection