cli-microsoft365 icon indicating copy to clipboard operation
cli-microsoft365 copied to clipboard

New command: 🔐 spo folder roleinheritance break

Open Adam-it opened this issue 2 years ago • 5 comments

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.

Adam-it avatar Aug 20 '22 20:08 Adam-it

@pnp/cli-for-microsoft-365-maintainers added new one 😉 Waiting for comments 👍

Adam-it avatar Aug 20 '22 20:08 Adam-it

What about adding folderId as option?

martinlingstuyl avatar Aug 20 '22 20:08 martinlingstuyl

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?

Adam-it avatar Aug 20 '22 21:08 Adam-it

Ok, that's a fair point. I'll create an issue to get folders by Id.

martinlingstuyl avatar Aug 21 '22 14:08 martinlingstuyl

Ok, that's a fair point. I'll create an issue to get folders by Id.

Ok, making this ready to be taken then 👍

Adam-it avatar Aug 21 '22 16:08 Adam-it

I would like to work on this one!

MathijsVerbeeck avatar Oct 06 '22 21:10 MathijsVerbeeck

Awesome @MathijsVerbeeck, all yours!

milanholemans avatar Oct 06 '22 21:10 milanholemans