pnp / pnp/cli-microsoft365

New command: `spe containertype permission add`

Open
#6,760 5 comments 1 reaction 1 assignee View on GitHub

@milanholemans is already working on this.

Since Jun 17, 2025.

keep-open needs design new feature
Dominant language
TypeScript
Stars
1.5k
Forks
413
Avg merge
5d 6h
Merged PRs (30d)
21

Description

Usage

m365 spe containertype permission add [options]

Description

Adds an application permission to a container type

Options
Option Description
--containerTypeId [containerTypeId] The ID of the container type. Specify either containerTypeId or containerTypeName, but not both.
--containerTypeName [containerTypeName] The name of the container type. Specify either containerTypeId or containerTypeName, but not both.
--appId [appId] The ID of the application to which permissions will be assigned. Specify either appId, appName, or omit both. Defaults to the current application.
--appName [appName] The display name of the application to which permissions will be assigned. Specify either appId, appName, or omit both. Defaults to the current application.
--delegatedPermissions [delegatedPermissions] Comma-separated list of permission scopes to add as delegated permission. Check the remarks section for possible permission scopes. Defaults to none.
--applicationPermissions [applicationPermissions] Comma-separated list of permission scopes to add as application-only permission. Check the remarks section for possible permission scopes. Defaults to none.
Examples

Grant full application permissions for the current application

m365 spe containertype permission add --containerTypeId 4ec4aefd-4fa3-0e4a-20c3-6e68389e7138 --applicationPermissions full

Grant full delegated permissions for the Graph Explorer

m365 spe containertype permission add --containerTypeId 4ec4aefd-4fa3-0e4a-20c3-6e68389e7138 --appId "@graphExplorerId" --delegatedPermissions full

Grants multiple permissions for a different application

m365 spe containertype permission add --containerTypeName "Contoso container type" --appId 14f213b8-a674-401d-9bbe-b5e0738d1316 --delegatedPermissions "read,create,enumeratePermissions" --applicationPermissions "read,write,enumeratePermissions,addPermissions"
Default properties

No response

Additional Info

FYI: The graph explorer principal ID is: de8bc8b5-d9f9-48b1-a8ad-b748da725064

Remarks

[!TIP]
When specifying @graphExplorerId as a value for the option applicationId, the permission will be granted to the Graph Explorer principal.

When specifying permission scopes, these are the valid options:

Permission Description
none Has no permissions to any containers or content of this container type.
readContent Can read the content of containers of this container type.
writeContent Can write content to containers for this container type. This can't be granted without the ReadContent permission.
create Can create containers of this container type.
delete Can delete containers of this container type.
read Can read the metadata of containers of this container type.
write Can update the metadata of containers of this container type.
enumeratePermissions Can enumerate the members of a container and their roles for containers of this container type.
addPermissions Can add members to the container for containers of this container type.
updatePermissions Can update (change roles of) existing memberships in the container for containers of this container type.
deletePermissions Can delete other members (but not self) from the container for containers of this container type.
deleteOwnPermissions Can remove own membership from the container for containers of this container type.
managePermissions Can add, remove (including self), or update members in the container roles for containers of this container type.
manageContent Can manage the content of the container.
full Has all permissions for containers of this container type.

Note that the permissions above can be combined apart from none and full.


Documentation

https://learn.microsoft.com/en-us/graph/api/filestoragecontainertyperegistration-post-applicationpermissiongrants

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.