Skip to content

New command: 🔐 spo file roleinheritance reset #3595

@Adam-it

Description

@Adam-it

Usage

m365 spo file roleinheritance reset [options]

Description

Restores the role inheritance of file

Options

Option Description
-u, --webUrl <webUrl> URL of the site where the file for which to reset role inheritance is located
--fileUrl [fileUrl] The server-relative URL of the file to retrieve. Specify either file url or file id but not both
-i, --fileId [fileId] The UniqueId (GUID) of the file to retrieve. Specify either file url or file id but not both
--confirm Don't prompt for confirmation

Examples

Reset inheritance of file with id (UniqueId) b2307a39-e878-458b-bc90-03bc578531d6 located in site https://contoso.sharepoint.com/sites/project-x

m365 spo file roleinheritance reset --webUrl "https://contoso.sharepoint.com/sites/project-x" --fileId "b2307a39-e878-458b-bc90-03bc578531d6" 

Reset inheritance of file with server-relative url /sites/project-x/documents/Test1.docx located in site https://contoso.sharepoint.com/sites/project-x

m365 spo file roleinheritance reset --webUrl "https://contoso.sharepoint.com/sites/project-x" --fileUrl "/sites/project-x/documents/Test1.docx"

Additional Info

I suggest we use Cli.executeCommandWithOutput and in the command implementation reuse the m365 spo listitem roleinheritance reset command which will also work in this case but we just need to pass the listItem Id. So the command should handle getting the correct file list item id by passed fileId or fileUrl and execute the listeItem roleinheritance reset command 👍

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions