microsoftgraph / microsoftgraph/msgraph-sdk-java

No way to list `Sites.Selected` collection available for application

Đang mở
#2,090 8 bình luận 1 reaction 1 người được giao Xem trên GitHub

@Ndiritu đang làm issue này rồi.

Từ ngày 12/8/2024.

Status: Needs Investigation type:question
Ngôn ngữ chính
Java
Star
444
Fork
154
Merge trung bình
18 giờ 28 phút
Pull request đã merge (30 ngày)
4

Mô tả

Describe the bug

When an app has Sites.Read.All api permission, it can list all available sites.
But when it has Sites.Selected only and was granted permissions to selected sites
via POST /v1.0/sites/{siteId}/permissions

{
    "roles": [
        "read"
    ],
    "grantedToIdentities": [
        {
            "application": {
                "id": "{clientId}",
                "displayName": "Name"
            }
        }
    ]
} 

There is no way to list these site available to the application:

client.sites().get().getValue();
results 0

client.sites().get(requestConfiguration -> {
    requestConfiguration.queryParameters.select = new String[]{"siteCollection", "webUrl"};
    requestConfiguration.queryParameters.filter = "siteCollection/root ne null";
}).getValue()

results: Access denied

client.sites().getAllSites().get().getValue();

results: Access denied

Expected behavior

Some api call which returns available via Sites.Selected

How to reproduce
  1. Set Sites.Selected permissions to application
  2. Add site permission to the selected collection POST /v1.0/sites/{siteId}/permissions
{
    "roles": [
        "read"
    ],
    "grantedToIdentities": [
        {
            "application": {
                "id": "{clientId}",
                "displayName": "Name"
            }
        }
    ]
}
  1. Call
client.sites().getAllSites().get().getValue();

observe empty result collection

SDK Version

6.10.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.