SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.01k forks source link

Hub Sites REST API description inaccurate #8612

Open jimmywim opened 1 year ago

jimmywim commented 1 year ago

The text Gets information about all hub sites that the current user can access. is inaccurate based on the existing behaviour, specifically the phrase the current user can access.

The existing behaviour appears to be that the hub sites that are returned are the hub sites where the People who can associate sites with this hub is either blank, or the current user is listed in there (this relates to the Targets property on a particular Hub).

Either this documentation needs to be updated to reflect this fact if this is indeed the intended behaviour, or a bug raised against the API if this is not the intended behaviour.

I would prefer if any user can see all hub sites with this API (or sites they have at least Read access to), and other APIs for Hub Sites (e.g. Join Hub Site) actively prevent the user from joining if they are not listed in the Targets property for the hub.

I currently use this API to retrieve hub site data for the tenant and use a custom SPFX extension to render a custom hierarchical navigation component, and presently I have to instruct users to not use the People who can associate sites with this hub feature in the admin centre, otherwise, users not listed here cannot retrieve information about the hub and it won't render.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ghost commented 1 year ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

bcameron1231 commented 1 year ago

Is this something you could achieve with the Search API instead (something I've done in the past for this same reason)? We can use the internal managed properties isHubSite and departmentId to determine a hubsite and related sites... or are you stuck wanting to use the hubsite REST API instead?