-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Category
- Question
- Typo
- Bug
- Additional article idea
Expected or Desired Behavior
When calling the Hubsite REST API with the GetById method, I should be able to get information about the hub if I have access anywhere within it.
Observed Behavior
Behaviors change between tenants but the following behavior is seen on multiple tenants right now.
When requesting a hub with a hubsiteid that exists and should work, we get an access denied error :
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>-2147024891, System.UnauthorizedAccessException</m:code>
<m:message xml:lang="en-US">
Access denied. You do not have permission to perform this action or access this resource.
</m:message>
</m:error>I believe this resource should always return data if the connected user has access to any site that is associated to the hub.
Steps to Reproduce
- Create a new site
- Register it as a hub
- Add a reader accounts to the root of the hub
- Connect to the site with the reader account
- Run the following REST call in your browser https://tenant.sharepoint.com/_api/HubSites/GetById?hubSiteId='f93eff08-5806-499c-92db-38800eefbe44'
On some tenants this will work all the time, some tenants will have different behavior based on the hub (nothing different between hubs) and some tenants will never work.
I also validated that no "specific" rights were assigned to "join" a hub on those hubs (for example, using the Grant-PnPHubsiteRights Cmdlet.
Discussion
I'm about to thing that this API should not be public as I can update the hub using the GetById method (which seems... weird?) and could also expose data to readers that they should not see (the ACLs of which users / groups can or cannot create sites joined to the hub.