cli-microsoft365: New command: πŸ” spo web roleinheritance break

Usage

m365 spo web roleinheritance break [options]

Description

break inheritance of subsite. Keeping existing permissions is the default behavior.

Options

Option Description
-u, --webUrl <webUrl> URL of the site
-c --clearExistingPermissions Flag if used clears all roles from the web
--confirm Don’t prompt for confirmation

Examples

break role inheritance on web with keeping existing permissions

m365 spo web roleinheritance break  --webUrl "https://contoso.sharepoint.com/sites/contoso-sales"

break role inheritance on web with clearing existing permissions

m365 spo web roleinheritance break  --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --clearExistingPermissions

Additional Info

I did some research and for this command we may use the POST request

/_api/web/breakroleinheritance(${TrueOrFalseHere})

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (10 by maintainers)

Most upvoted comments

yeah, we finally make it, thanks @milanholemans

Updated the specs to add an extra option --confirm. Discussed here: https://github.com/pnp/cli-microsoft365/issues/3593#issuecomment-1234828680

will send pull request this week, thx

sorry is these steps correct?

  1. i fork this repo
  2. create a file call β€œweb-break-inhreitance.ts” in src/m365/spo/commands/web
  3. fire a pull request
  4. done

Spec seems solid. Let’s do it! πŸš€