| title | Update shiftsRoleDefinition |
|---|---|
| description | Updates shifts role definition. |
| author | galalalym |
| ms.localizationpriority | medium |
| ms.subservice | teams |
| doc_type | apiPageType |
| ms.date | 06/22/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Update a shiftsRoleDefinition object.
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]
PATCH /team/{teamId}/schedule/shiftsRoleDefinitions/{roleId}| Parameter | Type | Description |
|---|---|---|
| teamId | string | Team ID to set the role definitions. |
| roleId | string | The affected role. Current supported values are teamowner and scheduleowner. |
| Name | Description |
|---|---|
| scheduleOwner | Sets definitions for a schedule owner. |
| teamOwner | Sets definitions for a team owner. |
| 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. |
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. |
If successful, this method returns a 204 No Content response code. It doesn't return anything in the response body.
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"
]
}
]
}The following example shows the response.
HTTP/1.1 204 No ContentThe 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": []
}
]
}The following example shows the response.
HTTP/1.1 204 No Content