Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to list Sites.Selected collection available for application #2090

Open
denysobukh opened this issue Jul 23, 2024 · 1 comment
Open
Assignees
Labels

Comments

@denysobukh
Copy link

denysobukh commented Jul 23, 2024

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_
@denysobukh denysobukh added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Jul 23, 2024
@denysobukh denysobukh changed the title No way to list Sites.Selected collection available for client No way to list Sites.Selected collection available for application Jul 23, 2024
@Ndiritu Ndiritu added type:question An issue that's a question and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Aug 12, 2024
@Ndiritu Ndiritu self-assigned this Aug 12, 2024
@SashaUsov
Copy link

The same empty site result list for SDK v.6.16.0 and UsernamePasswordCredential provider
#2184

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants