Skip to main content

directory_role_definitions

Creates, updates, deletes, gets or lists a directory_role_definitions resource.

Overview

Namedirectory_role_definitions
TypeResource
Identra_id.role_management.directory_role_definitions

Fields

The following fields are returned by SELECT queries:

Retrieved navigation property

NameDatatypeDescription
idstringThe unique identifier for an entity. Read-only.
descriptionstringThe description for the unifiedRoleDefinition. Read-only when isBuiltIn is true.
displayNamestringThe display name for the unifiedRoleDefinition. Read-only when isBuiltIn is true. Required. Supports $filter (eq, in).
inheritsPermissionsFromarrayRead-only collection of role definitions that the given role definition inherits from. Only Microsoft Entra built-in roles (isBuiltIn is true) support this attribute. Supports $expand.
isBuiltInbooleanFlag indicating whether the role definition is part of the default set included in Microsoft Entra or a custom definition. Read-only. Supports $filter (eq, in).
isEnabledbooleanFlag indicating whether the role is enabled for assignment. If false the role is not available for assignment. Read-only when isBuiltIn is true.
resourceScopesarrayList of the scopes or permissions the role definition applies to. Currently only / is supported. Read-only when isBuiltIn is true. DO NOT USE. This will be deprecated soon. Attach scope to role assignment.
rolePermissionsarrayList of permissions included in the role. Read-only when isBuiltIn is true. Required.
templateIdstringCustom template identifier that can be set when isBuiltIn is false but is read-only when isBuiltIn is true. This identifier is typically used if one needs an identifier to be the same across different directories.
versionstringIndicates version of the role definition. Read-only when isBuiltIn is true.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectunified_role_definition_idRead the properties and relationships of a unifiedRoleDefinition object. The following role-based access control (RBAC) providers are currently supported:
listselectGet a list of unifiedRoleDefinition objects for the provider. The following RBAC providers are currently supported:
- directory (Microsoft Entra ID)
- entitlement management (Microsoft Entra Entitlement Management)
insertinsertCreate a new custom unifiedRoleDefinition object. This feature requires a Microsoft Entra ID P1 or P2 license.
updateupdateunified_role_definition_idUpdate the properties of a unifiedRoleDefinition object. You cannot update built-in roles. This feature requires a Microsoft Entra ID P1 or P2 license.
deletedeleteunified_role_definition_idIf-MatchDelete a unifiedRoleDefinition object. You can't delete built-in roles. This feature requires a Microsoft Entra ID P1 or P2 license.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
unified_role_definition_idstringThe unique identifier of unifiedRoleDefinition
If-MatchstringETag

SELECT examples

Read the properties and relationships of a unifiedRoleDefinition object. The following role-based access control (RBAC) providers are currently supported:

SELECT
id,
description,
displayName,
inheritsPermissionsFrom,
isBuiltIn,
isEnabled,
resourceScopes,
rolePermissions,
templateId,
version
FROM entra_id.role_management.directory_role_definitions
WHERE unified_role_definition_id = '{{ unified_role_definition_id }}' -- required
;

INSERT examples

Create a new custom unifiedRoleDefinition object. This feature requires a Microsoft Entra ID P1 or P2 license.

INSERT INTO entra_id.role_management.directory_role_definitions (
id,
description,
displayName,
isBuiltIn,
isEnabled,
resourceScopes,
rolePermissions,
templateId,
version,
inheritsPermissionsFrom
)
SELECT
'{{ id }}',
'{{ description }}',
'{{ displayName }}',
{{ isBuiltIn }},
{{ isEnabled }},
'{{ resourceScopes }}',
'{{ rolePermissions }}',
'{{ templateId }}',
'{{ version }}',
'{{ inheritsPermissionsFrom }}'
RETURNING
id,
description,
displayName,
inheritsPermissionsFrom,
isBuiltIn,
isEnabled,
resourceScopes,
rolePermissions,
templateId,
version
;

UPDATE examples

Update the properties of a unifiedRoleDefinition object. You cannot update built-in roles. This feature requires a Microsoft Entra ID P1 or P2 license.

UPDATE entra_id.role_management.directory_role_definitions
SET
id = '{{ id }}',
description = '{{ description }}',
displayName = '{{ displayName }}',
isBuiltIn = {{ isBuiltIn }},
isEnabled = {{ isEnabled }},
resourceScopes = '{{ resourceScopes }}',
rolePermissions = '{{ rolePermissions }}',
templateId = '{{ templateId }}',
version = '{{ version }}',
inheritsPermissionsFrom = '{{ inheritsPermissionsFrom }}'
WHERE
unified_role_definition_id = '{{ unified_role_definition_id }}' --required
RETURNING
id,
description,
displayName,
inheritsPermissionsFrom,
isBuiltIn,
isEnabled,
resourceScopes,
rolePermissions,
templateId,
version;

DELETE examples

Delete a unifiedRoleDefinition object. You can't delete built-in roles. This feature requires a Microsoft Entra ID P1 or P2 license.

DELETE FROM entra_id.role_management.directory_role_definitions
WHERE unified_role_definition_id = '{{ unified_role_definition_id }}' --required
AND If-Match = '{{ If-Match }}'
;