Update shiftsRoleDefinition

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

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.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) Schedule.ReadWrite.All SchedulePermissions.ReadWrite.All
Delegated (personal Microsoft account) Not supported. Not supported.
Application Schedule.ReadWrite.All SchedulePermissions.ReadWrite.All

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.
Content-Type application/json. Required.
MS-APP-ACTS-AS A user ID (GUID). Required only if the authorization token is an application token; otherwise, optional.

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