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
def get_index_entity(entity_id, action=Authz.READ, **kwargs): entity = obj_or_404(_get_index_entity(entity_id, **kwargs)) require(request.authz.can(entity['collection_id'], action)) return entity