pnp / cli-microsoft365

Manage Microsoft 365 and SharePoint Framework projects on any platform
https://aka.ms/cli-m365
MIT License
908 stars 317 forks source link

New command: `spo folder roleassignment list` #6190

Open milanholemans opened 1 month ago

milanholemans commented 1 month ago

Usage

m365 spo folder roleassignment list [options]

Description

Lists all role assignments from a specific folder

Options

Option Description
-u, --webUrl <webUrl> URL of the site where the folder is located.
--folderUrl [folderUrl] The server- or site-relative decoded URL of the folder. Specify either folderUrl or folderId but not both.
-i, --folderId [folderId] The UniqueId (GUID) of the folder. Specify either folderUrl or folderId but not both.

Examples

List all role assignments of a folder specified by URL

m365 spo folder roleassignment list --webUrl "https://contoso.sharepoint.com/sites/Marketing" --folderUrl "/Branding/Logos"

List all role assignments of a folder specified by ID

m365 spo folder roleassignment list --webUrl "https://contoso.sharepoint.com/sites/Marketing" --folderId "04796e10-cb5f-4aa3-a438-bc06028a9073"

Default properties

Additional Info

API request

GET https://contoso.sharepoint.com/sites/Marketing/_api/Web/GetFolderByServerRelativePath(decodedUrl='/sites/Marketing/Branding/Logos')/ListItemAllFields/RoleAssignments?$expand=Member,RoleDefinitionBindings&$select=*,Member,RoleDefinitionBindings
Adam-it commented 1 month ago

it is already possible to retrieve this information when running m365 spo folder get --withPermissions