pnp / cli-microsoft365

Manage Microsoft 365 and SharePoint Framework projects on any platform
https://aka.ms/cli-m365
MIT License
927 stars 326 forks source link

New command: `entra roledefinition list` #6464

Open MartinM85 opened 2 weeks ago

MartinM85 commented 2 weeks ago

Usage

m365 entra roledefinition list

Description

Lists all Microsoft Entra ID role definitions

Options

Option Description
-p, --properties [properties] Comma-separated list of properties to retrieve.
-f, --filter [filter] OData filter to apply when retrieving the role definitions.

Examples

Retrieve all Microsoft Entra ID role definitions

m365 entra roledefinition list

Retrieve only the names of the role definitions

m365 entra roledefinition list --properties 'displayName'

Retrieve only custom role definitions

m365 entra roledefinition list --filter 'isBuiltIn eq false'

Default properties

Additional Info

More info: https://learn.microsoft.com/en-us/graph/api/rbacapplication-list-roledefinitions?view=graph-rest-1.0&tabs=http#for-the-directory-microsoft-entra-id-provider

milanholemans commented 2 weeks ago

Hi @MartinM85 nice suggestion once again.

A few things that come to mind:

MartinM85 commented 2 weeks ago

Hi @milanholemans, Directory.ReadWrite.All will definitely work. RoleManagement.Read.Directory is the least privileged permission required to run the command, but it not needed. Spec updated

milanholemans commented 2 weeks ago

Since Directory.ReadWrite.All is already included in our permission scope, I suggest we don't add the lower privileged scope.