def METHOD_NAME(client, librarian_martigny,
                                    system_librarian_martigny,
                                    item_type_standard_martigny,
                                    item_type_regular_sion):
    """Test patron types permissions api."""
    itty_permissions_url = url_for(
        'api_blueprint.permissions',
        route_name='item_types'
    )
    itty_martigny_permissions_url = url_for(
        'api_blueprint.permissions',
        route_name='item_types',
        record_pid=item_type_standard_martigny.pid
    )
    itty_sion_permissions_url = url_for(
        'api_blueprint.permissions',
        route_name='item_types',
        record_pid=item_type_regular_sion.pid
    )
    # Not logged
    res = client.get(itty_permissions_url)
    assert res.status_code == 401
    # Logged as librarian
    #   * lib can 'list' item_type
    #   * lib can 'read' item_type from its own organisation
    #   * lib can't never 'create', 'delete', 'update' item_type
    login_user_via_session(client, librarian_martigny.user)
    res = client.get(itty_martigny_permissions_url)
    assert res.status_code == 200
    data = get_json(res)
    for action in ['list', 'read']:
        assert data[action]['can']
    for action in ['create', 'update', 'delete']:
        assert not data[action]['can']
    res = client.get(itty_sion_permissions_url)
    data = get_json(res)
    assert not data['read']['can']
    # Logged as system librarian
    #   * sys_lib can do anything about item_type for its own organisation
    #   * sys_lib can't do anything about item_type for other organisation
    login_user_via_session(client, system_librarian_martigny.user)
    res = client.get(itty_martigny_permissions_url)
    assert res.status_code == 200
    data = get_json(res)
    for action in ['list', 'read', 'create', 'update', 'delete']:
        assert data[action]['can']
    res = client.get(itty_sion_permissions_url)
    assert res.status_code == 200
    data = get_json(res)
    for action in ['update', 'delete']:
        assert not data[action]['can']