Skip to content

New command: m365 spe container permission list #6162

Closed
@Adam-it

Description

@Adam-it

Usage

m365 spe container permission list [options]

Description

Lists permissions of a SharePoint Embedded Container

Options

Option Description
-i, --containerId <id> The ID of the SharePoint Embedded Container

Examples

Lists Container permissions

m365 spe container permission list --containerId "b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z" 

Default properties

  • id
  • userPrincipalName
  • roles

Additional Info

we may use the following API:
https://learn.microsoft.com/en-us/graph/api/filestoragecontainer-list-permissions?view=graph-rest-1.0&tabs=http

since the response is a complex object like

"value": [
    {
        "@odata.type": "#microsoft.graph.permission",
        "id": "cmVhZGVyX2k6MCMuZnxtZW1iZXJzaGlwfHJvcnlicjExMUBvdXRsb29rLmNvbQ",
        "roles": ["principalOwner"],
        "grantedToV2": {
          "user": {
            "id": "71392b2f-1765-406e-86af-5907d9bdb2ab",
            "userPrincipalName": "[email protected]",
            "displayName": "Jacob Hancock",
            "email": "[email protected]"
          }
        }
    },
    {
        "@odata.type": "#microsoft.graph.permission",
        "id": "cHJpbmNpcGFsT3duZXJfaTowIy5mfG1lbWJlcnNoaXB8ZGxpZGRlbGwyMDIyQG91dGxvb2suY29t",
        "roles": ["reader"],
        "grantedToV2": {
          "user": {
            "id": "86503198-b81b-43fe-81ee-ad45b8848ac9",
            "userPrincipalName": "[email protected]",
            "displayName": "Mark Nickhols",
            "email": "[email protected]"
          }
        }
    }

we will need to extract/modify it for to fit the format of the default response. We will need return roles as a comma separated list and extract the userPrincipalName from the user object

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions