def METHOD_NAME(client, patron_martigny,
                                      org_martigny, org_sion,
                                      system_librarian_martigny):
    """Test organisations permissions api."""
    org_permissions_url = url_for(
        'api_blueprint.permissions',
        route_name='organisations'
    )
    org_martigny_permission_url = url_for(
        'api_blueprint.permissions',
        route_name='organisations',
        record_pid=org_martigny.pid
    )
    org_sion_permission_url = url_for(
        'api_blueprint.permissions',
        route_name='organisations',
        record_pid=org_sion.pid
    )
    # Not logged
    res = client.get(org_permissions_url)
    assert res.status_code == 401
    # Logged as patron
    login_user_via_session(client, patron_martigny.user)
    res = client.get(org_permissions_url)
    assert res.status_code == 403
    # Logged as system librarian
    #   * sys_lib can 'list' organisations
    #   * sys_lib can never 'create' and 'delete' any organisation
    #   * sys_lib can 'read' and 'update' only their own organisation
    login_user_via_session(client, system_librarian_martigny.user)
    res = client.get(org_martigny_permission_url)
    assert res.status_code == 200
    data = get_json(res)
    assert data['read']['can']
    assert data['list']['can']
    assert not data['create']['can']
    assert data['update']['can']
    assert not data['delete']['can']
    res = client.get(org_sion_permission_url)
    assert res.status_code == 200
    data = get_json(res)
    assert not data['read']['can']
    assert not data['update']['can']