def __get_mongodb_right(self, entity_id, rights):
        sql = """
            SELECT related_entity_id
            FROM relationship
            WHERE relationship_definition_keyname IN (%s)
            AND is_deleted = 0
            AND related_entity_id IS NOT NULL
            AND entity_id = %s
        """ % (', '.join(['\'%s\'' % x for x in rights]), entity_id)

        entities = []
        for r in self.db_query(sql):
            entities.append(r.get('related_entity_id'))

        return entities
dataset/ETHPy150Open argoroots/Entu/app/main/db.py/Entity.__get_mongodb_right/original