Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 128 additions & 0 deletions docs/docs/cmd/spe/container/container-permission-add.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import Global from '../../_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# spe container permission add

Adds permission to SharePoint Embedded Container for a specified user

## Usage

```sh
m365 spe container permission add [options]
```

## Options

```md definition-list
`-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.

`--containerTypeId [containerTypeId]`
: The ID of the container type. Specify either `containerTypeId` or `containerTypeName` when using `containerName` but not both.

`--containerTypeName [containerTypeName]`
: The name of the container type. Specify either `containerTypeId` or `containerTypeName` when using `containerName` but not both.

`-r, --roles <roles>`:
: Comma separated list of permissions. Possible values are `reader`, `writer`, `manager`, `owner`.

`--userId [userId]`
: The id of user to assign role to. Use either `userId` or `userName` but not both.

`--userName [userName]`
: The upn/email of user to assign role to. Use either `userId` or `userName` but not both.
```

## Permissions

<Tabs>
<TabItem value="Delegated">

| Resource | Permissions |
|-----------------|-------------------------------|
| Microsoft Graph | FileStorageContainer.Selected |

</TabItem>
<TabItem value="Application">

| Resource | Permissions |
|-----------------|-------------------------------|
| Microsoft Graph | FileStorageContainer.Selected |

</TabItem>
</Tabs>

## Examples

Adds a reader role for the specified user to the container

```sh
m365 spe container permission add --containerId "b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z" --roles "reader" --userName "jacob@fabrikam.com"
```

Adds a multiple roles for the specified user to the container

```sh
m365 spe container permission add --containerId "b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z" --roles "reader,writer" --userName "jacob@fabrikam.com"
```

## Response

<Tabs>
<TabItem value="JSON">

```json
{
"id": "cJpbmNpcGFsT3duZAJfaLowIy5mfG1lbWJliZXJzaGlwfHJvcnlicjExMUBvdXRsb29rLmNvbQ",
"roles": ["reader"],
"grantedToV2": {
"user": {
"id": "89ea5c94-7736-4e25-95ad-3fa95f62b66e",
"userPrincipalName": "john.doe@contoso.com",
"displayName": "John Doe",
"email": "john.doe@contoso.com"
}
}
}
```

</TabItem>
<TabItem value="Text">

```text
id userPrincipalName roles
-------------------------------------------------------------------------- --------------------- ------
cJpbmNpcGFsT3duZAJfaLowIy5mfG1lbWJliZXJzaGlwfHJvcnlicjExMUBvdXRsb29rLmNvbQ john.doe@contoso..com reader
```

</TabItem>
<TabItem value="CSV">

```csv
id,roles,userPrincipalName
cJpbmNpcGFsT3duZAJfaLowIy5mfG1lbWJliZXJzaGlwfHJvcnlicjExMUBvdXRsb29rLmNvbQ,reader,john.doe@contoso.com
```

</TabItem>
<TabItem value="Markdown">

```md
# spe container permission add --containerId "b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z" --userId "89ea5c94-7736-4e25-95ad-3fa95f62b66e" --roles "reader"

Date: 8/5/2025

## X2k6MCMuZnxtZW1iZXJzaGlwfGRlYnJhYkBuYWNoYW4zNjUub25taWNyb3NvZnQuY29t

Property | Value
---------|-------
id | cJpbmNpcGFsT3duZAJfaLowIy5mfG1lbWJliZXJzaGlwfHJvcnlicjExMUBvdXRsb29rLmNvbQ
roles | reader
userPrincipalName | john.doe@contoso.com
```

</TabItem>
</Tabs>
2 changes: 1 addition & 1 deletion docs/docs/cmd/spe/containertype/containertype-add.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ The registration of a container type in a newly created tenant can fail if the t
Adds a new trial container type.

```sh
m365 spe containertype add --name 'trial container' --applicationId '1b3b8660-9a44-4a7c-9c02-657f3ff5d5ac' --billingType trial
m365 spe containertype add --name 'trial container' --appId '1b3b8660-9a44-4a7c-9c02-657f3ff5d5ac' --billingType trial
```

Adds a new container type using a standard billing type for the current application.
Expand Down
5 changes: 5 additions & 0 deletions docs/src/config/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2216,6 +2216,11 @@ const sidebars: SidebarsConfig = {
label: 'container remove',
id: 'cmd/spe/container/container-remove'
},
{
type: 'doc',
label: 'container permission add',
id: 'cmd/spe/container/container-permission-add'
},
{
type: 'doc',
label: 'container permission list',
Expand Down
1 change: 1 addition & 0 deletions src/m365/spe/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default {
CONTAINER_GET: `${prefix} container get`,
CONTAINER_LIST: `${prefix} container list`,
CONTAINER_REMOVE: `${prefix} container remove`,
CONTAINER_PERMISSION_ADD: `${prefix} container permission add`,
CONTAINER_PERMISSION_LIST: `${prefix} container permission list`,
CONTAINER_RECYCLEBINITEM_LIST: `${prefix} container recyclebinitem list`,
CONTAINER_RECYCLEBINITEM_REMOVE: `${prefix} container recyclebinitem remove`,
Expand Down
Loading
Loading