Skip to content

Commit

Permalink
Adds 'm365 entra app permission list' command. Closes pnp#5668
Browse files Browse the repository at this point in the history
  • Loading branch information
nicodecleyre authored and Adam-it committed Feb 11, 2024
1 parent 679c57d commit 7076f2e
Show file tree
Hide file tree
Showing 6 changed files with 10,713 additions and 0 deletions.
105 changes: 105 additions & 0 deletions docs/docs/cmd/entra/app/app-permission-list.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# entra app permission list

Lists the application and delegated permissions for a specified Entra Application Registration

## Usage

```sh
m365 entra app permission list [options]
```

## Alias

```sh
m365 aad app permission list [options]
```

## Options

```md definition-list
`-i, --appId [appId]`
: Client ID of the Application Registration to retrieve the permissions for. Specify `appId` or `appObjectId` but not both.

`--appObjectId [appObjectId]`
: Object ID of the Application Registration to retrieve the permissions for. Specify `appId` or `appObjectId` but not both.

`--type [type]`
: The type of permissions to retrieve. Allowed values: `delegated`, `application`, `all`. Defaults to `all`.
```

<Global />

## Remarks

For best performance use the `objectId` option to reference the Entra application registration to get. If you use `appId`, this command will first need to find the corresponding object ID for that application.

## Examples

Retrieves all permissions for an Entra app registration

```sh
m365 entra app permission list --appId 'f1417aa3-bf0b-4cc5-a845-a0b2cf11f690'
```

Retrieves all delegated permissions for an Entra app registration

```sh
m365 entra app permission list --appId 'f1417aa3-bf0b-4cc5-a845-a0b2cf11f690' --type delegated
```

## Response

<Tabs>
<TabItem value="JSON">

```json
[
{
"resource": "Microsoft Graph",
"resourceId": "00000003-0000-0000-c000-000000000000",
"permission": "User.Read",
"type": "Delegated"
}
]
```

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

```text
resource resourceId permission type
---------------------------- ------------------------------------ --------------------------------- -----------
Microsoft Graph 00000003-0000-0000-c000-000000000000 User.Read Delegated
```

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

```csv
resource,resourceId,permission,type
Microsoft Graph,00000003-0000-0000-c000-000000000000,User.Read,Delegated
```

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

```md
# entra app permission list --appId "2bf26ae1-9be3-425f-a393-5fe8390e3a36"

Date: 27/12/2023

Property | Value
---------|-------
resource | Microsoft Graph
resourceId | 00000003-0000-0000-c000-000000000000
permission | User.Read
type | Delegated
```

</TabItem>
</Tabs>

5 changes: 5 additions & 0 deletions docs/src/config/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ const sidebars: SidebarsConfig = {
label: 'app permission add',
id: 'cmd/entra/app/app-permission-add'
},
{
type: 'doc',
label: 'app permission list',
id: 'cmd/entra/app/app-permission-list'
},
{
type: 'doc',
label: 'app role add',
Expand Down
1 change: 1 addition & 0 deletions src/m365/entra/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default {
APP_REMOVE: `${prefix} app remove`,
APP_SET: `${prefix} app set`,
APP_PERMISSION_ADD: `${prefix} app permission add`,
APP_PERMISSION_LIST: `${prefix} app permission list`,
APP_ROLE_ADD: `${prefix} app role add`,
APP_ROLE_LIST: `${prefix} app role list`,
APP_ROLE_REMOVE: `${prefix} app role remove`,
Expand Down
Loading

0 comments on commit 7076f2e

Please sign in to comment.