def enforce_access_rights(update):
    """
    Check that the update should be allowed.
    """
    if update.old:
        if update.user != update.old.get_owner() and update.user.role not in [
            'admin', 'owner']:
            raise Exception('Not permitted to modify existing chute {}'.
                format(update.old.name))
