Skip to content

Latest commit

 

History

History
151 lines (115 loc) · 4.05 KB

File metadata and controls

151 lines (115 loc) · 4.05 KB
title Update shiftsRoleDefinition
description Updates shifts role definition.
author galalalym
ms.localizationpriority medium
ms.subservice teams
doc_type apiPageType
ms.date 06/22/2024

Update shiftsRoleDefinition

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Update a shiftsRoleDefinition object.

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

[!INCLUDE permissions-table]

HTTP request

PATCH /team/{teamId}/schedule/shiftsRoleDefinitions/{roleId}

Path parameters

Parameter Type Description
teamId string Team ID to set the role definitions.
roleId string The affected role. Current supported values are teamowner and scheduleowner.

Supported values for roleId

Name Description
scheduleOwner Sets definitions for a schedule owner.
teamOwner Sets definitions for a team owner.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.
MS-APP-ACTS-AS (deprecated) A user ID (GUID). Required only if the authorization token is an application token; otherwise, optional. The MS-APP-ACTS-AS header is deprecated and no longer required with application tokens.

Request body

In the request body, supply a JSON representation of the shiftsRoleDefinition object.

You can specify the following properties when creating/updating a shiftsRoleDefinition.

Property Type Description
shiftsRolePermissions microsoft.graph.shiftsRolePermission collection Contains the definition for role permissions within a role. Required.

Response

If successful, this method returns a 204 No Content response code. It doesn't return anything in the response body.

Examples

Example 1: Set permissions for schedule owner

Request

The following example shows a request that enables the modification of scheduling groups and time off reasons by schedule owners.

PATCH https://graph.microsoft.com/beta/team/10c2c1cc-6384-48f6-aeba-ef7486344550/schedule/shiftsRoleDefinitions/scheduleowner
Content-Type: application/json

{
  "shiftsRolePermissions": [
    {
      "allowedResourceActions": [
        "CanModifySchedulingGroups",
        "CanModifyTimeOffReasons"
      ]
    }
  ]
}

Response

The following example shows the response.

HTTP/1.1 204 No Content

Example 2: Disable all permissions for schedule owner

Request

The following example shows a request that disables all permissions by passing an empty collection as the value for allowedResourceActions.

PATCH https://graph.microsoft.com/beta/team/10c2c1cc-6384-48f6-aeba-ef7486344550/schedule/shiftsRoleDefinitions/scheduleowner
Content-Type: application/json

{
  "shiftsRolePermissions": [
    {
      "allowedResourceActions": []
    }
  ]
}

Response

The following example shows the response.

HTTP/1.1 204 No Content