Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command: m365 spe container permission list #6162

Open
Adam-it opened this issue Jul 19, 2024 · 4 comments · May be fixed by #6631
Open

New command: m365 spe container permission list #6162

Adam-it opened this issue Jul 19, 2024 · 4 comments · May be fixed by #6631

Comments

@Adam-it
Copy link
Member

Adam-it commented Jul 19, 2024

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

@Adam-it Adam-it added new feature needs peer review Needs second pair of eyes to review the spec or PR labels Jul 19, 2024
@milanholemans
Copy link
Contributor

Hi @Adam-it, my remarks:

  • As description, I'd use Lists permissions of a Container
  • As description of the option id, maybe instead of a word, a short sentence: The ID of the SharePoint Embedded Container.
  • I see roles as default property. Since this is a list, do we have to format it to a comma-separated list?

@Adam-it
Copy link
Member Author

Adam-it commented Jul 23, 2024

Hi @Adam-it, my remarks:

  • As description, I'd use Lists permissions of a Container
  • As description of the option id, maybe instead of a word, a short sentence: The ID of the SharePoint Embedded Container.
  • I see roles as default property. Since this is a list, do we have to format it to a comma-separated list?

good comments @milanholemans 👏
I updated the spec. Check it out.
@pnp/cli-for-microsoft-365-maintainers any other comment before I open it up?

@milanholemans milanholemans added help wanted and removed needs peer review Needs second pair of eyes to review the spec or PR labels Jul 23, 2024
@Jwaegebaert
Copy link
Contributor

LGTM!

@Adam-it Adam-it added the hacktoberfest Issue perfect for hacktoberfest label Sep 24, 2024
@Adam-it Adam-it removed the hacktoberfest Issue perfect for hacktoberfest label Nov 3, 2024
@SmitaNachan
Copy link
Contributor

Can I work on it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants