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

New command: m365 spe container permission add

Open Adam-it opened this issue 1 year ago • 5 comments

Usage

m365 spe container permission add [options]

Description

Adds permission to SharePoint Embedded Container for a specified user

Options

Option Description
-i, --containerId [containerId] ID of a SharePoint Embedded container. Specify either containerId or containerName but not both.
-n, --containerName [containerName] Display name of the Container. Specify either containerId or containerName but not both.
-r, --roles <roles> Comma separated list of permissions. Possible values are reader, writer, manager, owner.
--userName [userName] The upn/email of user to assign role to. Use either userName or userId but not both.
--userId [userId] The id of user to assign role to. Use either userName or userId but not both.

Examples

Adds a reader role for the specified user to the container

m365 spe container permission add --containerId "b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z"  --roles "reader" --userName "[email protected]"

Adds a multiple roles for the specified user to the container

m365 spe container permission add --containerId "b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z"  --roles "reader,writer" --userName "[email protected]"

Default properties

No response

Additional Info

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

Adam-it avatar Jul 19 '24 20:07 Adam-it

One improvement could be adding another example, maybe one with multiple roles. We could also add userId, so they can set permissions using the user Entra ID.

Jwaegebaert avatar Jul 22 '24 07:07 Jwaegebaert

I think upn should also be renamed to userName to be consistent with other commands.

milanholemans avatar Jul 22 '24 17:07 milanholemans

I think upn should also be renamed to userName to be consistent with other commands.

updated ✅

One improvement could be adding another example, maybe one with multiple roles. We could also add userId, so they can set permissions using the user Entra ID.

Added additional example ✅ Improved a bit description ✅ and the description of the container ID ✅ Good call with the userId. added ✅

Adam-it avatar Jul 23 '24 06:07 Adam-it

@pnp/cli-for-microsoft-365-maintainers any other feed or should we open it up?

Adam-it avatar Jul 23 '24 07:07 Adam-it

Made a few small remaining changes. LGTM!

milanholemans avatar Jul 23 '24 07:07 milanholemans