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

Connect and disconnect hub site as SP admin #5970

Open
milanholemans opened this issue Apr 8, 2024 · 5 comments
Open

Connect and disconnect hub site as SP admin #5970

milanholemans opened this issue Apr 8, 2024 · 5 comments

Comments

@milanholemans
Copy link
Contributor

milanholemans commented Apr 8, 2024

Currently, we have 2 commands spo site hubsite connect and spo hubsite disconnect. Right now, you need permission to the target site in order to run this command. I suggest we add an extra flag for these two commands:

Option Description
--asAdmin Run the command as admin for sites you don't have permission to.

Endpoint

The following endpoint should do the trick:

POST https://contoso-admin.sharepoint.com/_api/SPO.Tenant/ConnectSiteToHubSiteById
{
  "hubSiteId": "0cb3cff9-0578-4d70-bab4-bd1c796b9365",
  "siteUrl": "https://contoso.sharepoint.com/sites/Marketing"
}

To disconnect a site, use the same request with 00000000-0000-0000-0000-000000000000 as hub site ID.

@milanholemans milanholemans added enhancement good first issue needs peer review Needs second pair of eyes to review the spec or PR labels Apr 8, 2024
@Adam-it
Copy link
Contributor

Adam-it commented Apr 10, 2024

Great suggestion. I don't see any risks or problems. Let's ship it

@milanholemans milanholemans added help wanted and removed needs peer review Needs second pair of eyes to review the spec or PR labels Apr 10, 2024
@ADTmux
Copy link

ADTmux commented Apr 10, 2024

Hey I would like to work on this!

@milanholemans
Copy link
Contributor Author

Cool thank you @ADTmux!

@ADTmux
Copy link

ADTmux commented Apr 16, 2024

Hey @milanholemans , is there a way I could test spo site hubsite connect command if I do not have a Microsoft account that has admin permissions for my organization?

@Jwaegebaert
Copy link
Contributor

@ADTmux, if you don't have access to any kind of dev tenant then I'm afraid you won't be able to test the command. Admin rights are required especially when working with the SPO.Tenant endpoint.

@ADTmux ADTmux removed their assignment Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants