microsoftgraph / microsoftgraph/msgraph-sdk-java
No way to list `Sites.Selected` collection available for application
Open
@Ndiritu is already working on this.
Since Aug 12, 2024.
Status: Needs Investigation
type:question
- Dominant language
- Java
- Stars
- 444
- Forks
- 154
- Avg merge
- 18h 28m
- Merged PRs (30d)
- 4
Description
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
- Set
Sites.Selectedpermissions to application - Add site permission to the selected collection
POST /v1.0/sites/{siteId}/permissions
{
"roles": [
"read"
],
"grantedToIdentities": [
{
"application": {
"id": "{clientId}",
"displayName": "Name"
}
}
]
}
- 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_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.