cli-microsoft365
cli-microsoft365 copied to clipboard
New command: 🔐 spo folder roleinheritance break
Usage
m365 spo folder roleinheritance break [options]
Description
break inheritance of folder. Keeping existing permissions is the default behavior.
Options
Option | Description |
---|---|
-u, --webUrl <webUrl> |
URL of the site where the item for which to break role inheritance is located |
-f, --folderUrl <folderUrl> |
The site-relative URL of the folder |
-c, --clearExistingPermissions |
Set to clear existing roles from the list item |
--confirm |
Don't prompt for confirmation |
Examples
Break inheritance of folder with site-relative url /Shared Documents located in site https://contoso.sharepoint.com/sites/project-x
m365 spo folder roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --folderUrl "/Shared Documents"
Break inheritance of folder with site-relative url /Shared Documents located in site https://contoso.sharepoint.com/sites/project-x with clearing permissions
m365 spo folder roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --folderUrl "/Shared Documents" --clearExistingPermissions
Additional Info
we may also reuse command we already have using Cli.executeCommandWithOutput
. We may reuse the m365 spo folder get
command and the m365 spo listitem roleinheritance break
.
@pnp/cli-for-microsoft-365-maintainers added new one 😉 Waiting for comments 👍
What about adding folderId
as option?
What about adding
folderId
as option?
actually the spo folder get
command does not support it and I really wanted to reuse both commands not implement something again which we already have.
https://pnp.github.io/cli-microsoft365/cmd/spo/folder/folder-get/
if we extend that command with folderId
then I suggest we expose this option here as well
what do you think?
Ok, that's a fair point. I'll create an issue to get folders by Id.
Ok, that's a fair point. I'll create an issue to get folders by Id.
Ok, making this ready to be taken then 👍
I would like to work on this one!
Awesome @MathijsVerbeeck, all yours!