Skip to content

Commit

Permalink
New command: entra roledefinition remove
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinM85 committed Dec 13, 2024
1 parent 822383e commit 00f5252
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/utils/roleDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import request, { CliRequestOptions } from '../request.js';

export const roleDefinition = {
/**
* Get an Entra ID (directory) role by it's name
* Get an Entra ID (directory) role by its name
* @param displayName Role definition display name.
* @param properties Comma-separated list of properties to include in the response.
* @returns The role definition.
* @throws Error when role definition was not found.
*/
async getRoleDefinitionByDisplayName(displayName: string, properties: string = ''): Promise<UnifiedRoleDefinition> {
async getRoleDefinitionByDisplayName(displayName: string, properties?: string): Promise<UnifiedRoleDefinition> {
let url = `https://graph.microsoft.com/v1.0/roleManagement/directory/roleDefinitions?$filter=displayName eq '${formatting.encodeQueryParameter(displayName)}'`;
if (properties !== '') {
if (properties) {
url += `&$select=${properties}`;
}
const roleDefinitions = await odata.getAllItems<UnifiedRoleDefinition>(url);
Expand All @@ -33,15 +33,15 @@ export const roleDefinition = {
},

/**
* Get an Entra ID (directory) role by it's id
* Get an Entra ID (directory) role by its id
* @param id Role definition id.
* @param properties Comma-separated list of properties to include in the response.
* @returns The role definition.
* @throws Error when role definition was not found.
*/
async getRoleDefinitionById(id: string, properties: string = ''): Promise<UnifiedRoleDefinition> {
async getRoleDefinitionById(id: string, properties?: string): Promise<UnifiedRoleDefinition> {
let url = `https://graph.microsoft.com/v1.0/roleManagement/directory/roleDefinitions/${id}`;
if (properties !== '') {
if (properties) {
url += `?$select=${properties}`;
}

Expand Down

0 comments on commit 00f5252

Please sign in to comment.