def get(serial_number, internal=False):
    res = None
    installation = Installations_dao.get(serial_number)
    if installation:
        if internal or authentication.allow_viewing(installation.get('customer')):
            res = installation
    return res
def get_by_customer(customer_id):
    res = None
    if authentication.allow_viewing(customer_id):
        res = Installations_dao.get_all(customer_id)
    return res