feat: add server flag to disable user custom quiet hours (#11124)

This commit is contained in:
Dean Sheather
2023-12-15 19:33:51 +10:00
committed by GitHub
parent a58e4febb9
commit 1e49190e12
22 changed files with 358 additions and 46 deletions
+20 -16
View File
@@ -1352,6 +1352,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/quiet-hours \
"raw_schedule": "string",
"time": "string",
"timezone": "string",
"user_can_set": true,
"user_set": true
}
]
@@ -1367,14 +1368,15 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/quiet-hours \
Status Code **200**
| Name | Type | Required | Restrictions | Description |
| ---------------- | ----------------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------- |
| `[array item]` | array | false | | |
| `» next` | string(date-time) | false | | Next is the next time that the quiet hours window will start. |
| `» raw_schedule` | string | false | | |
| `» time` | string | false | | Time is the time of day that the quiet hours window starts in the given Timezone each day. |
| `» timezone` | string | false | | raw format from the cron expression, UTC if unspecified |
| `» user_set` | boolean | false | | User set is true if the user has set their own quiet hours schedule. If false, the user is using the default schedule. |
| Name | Type | Required | Restrictions | Description |
| ---------------- | ----------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `[array item]` | array | false | | |
| `» next` | string(date-time) | false | | Next is the next time that the quiet hours window will start. |
| `» raw_schedule` | string | false | | |
| `» time` | string | false | | Time is the time of day that the quiet hours window starts in the given Timezone each day. |
| `» timezone` | string | false | | raw format from the cron expression, UTC if unspecified |
| `» user_can_set` | boolean | false | | User can set is true if the user is allowed to set their own quiet hours schedule. If false, the user cannot set a custom schedule and the default schedule will always be used. |
| `» user_set` | boolean | false | | User set is true if the user has set their own quiet hours schedule. If false, the user is using the default schedule. |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
@@ -1418,6 +1420,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/quiet-hours \
"raw_schedule": "string",
"time": "string",
"timezone": "string",
"user_can_set": true,
"user_set": true
}
]
@@ -1433,14 +1436,15 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/quiet-hours \
Status Code **200**
| Name | Type | Required | Restrictions | Description |
| ---------------- | ----------------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------- |
| `[array item]` | array | false | | |
| `» next` | string(date-time) | false | | Next is the next time that the quiet hours window will start. |
| `» raw_schedule` | string | false | | |
| `» time` | string | false | | Time is the time of day that the quiet hours window starts in the given Timezone each day. |
| `» timezone` | string | false | | raw format from the cron expression, UTC if unspecified |
| `» user_set` | boolean | false | | User set is true if the user has set their own quiet hours schedule. If false, the user is using the default schedule. |
| Name | Type | Required | Restrictions | Description |
| ---------------- | ----------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `[array item]` | array | false | | |
| `» next` | string(date-time) | false | | Next is the next time that the quiet hours window will start. |
| `» raw_schedule` | string | false | | |
| `» time` | string | false | | Time is the time of day that the quiet hours window starts in the given Timezone each day. |
| `» timezone` | string | false | | raw format from the cron expression, UTC if unspecified |
| `» user_can_set` | boolean | false | | User can set is true if the user is allowed to set their own quiet hours schedule. If false, the user cannot set a custom schedule and the default schedule will always be used. |
| `» user_set` | boolean | false | | User set is true if the user has set their own quiet hours schedule. If false, the user is using the default schedule. |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
+1
View File
@@ -394,6 +394,7 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \
},
"update_check": true,
"user_quiet_hours_schedule": {
"allow_user_custom": true,
"default_schedule": "string"
},
"verbose": true,
+16 -10
View File
@@ -2324,6 +2324,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
},
"update_check": true,
"user_quiet_hours_schedule": {
"allow_user_custom": true,
"default_schedule": "string"
},
"verbose": true,
@@ -2700,6 +2701,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
},
"update_check": true,
"user_quiet_hours_schedule": {
"allow_user_custom": true,
"default_schedule": "string"
},
"verbose": true,
@@ -5659,15 +5661,17 @@ If the schedule is empty, the user will be updated to use the default schedule.|
```json
{
"allow_user_custom": true,
"default_schedule": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------------------ | ------ | -------- | ------------ | ----------- |
| `default_schedule` | string | false | | |
| Name | Type | Required | Restrictions | Description |
| ------------------- | ------- | -------- | ------------ | ----------- |
| `allow_user_custom` | boolean | false | | |
| `default_schedule` | string | false | | |
## codersdk.UserQuietHoursScheduleResponse
@@ -5677,19 +5681,21 @@ If the schedule is empty, the user will be updated to use the default schedule.|
"raw_schedule": "string",
"time": "string",
"timezone": "string",
"user_can_set": true,
"user_set": true
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| -------------- | ------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------- |
| `next` | string | false | | Next is the next time that the quiet hours window will start. |
| `raw_schedule` | string | false | | |
| `time` | string | false | | Time is the time of day that the quiet hours window starts in the given Timezone each day. |
| `timezone` | string | false | | raw format from the cron expression, UTC if unspecified |
| `user_set` | boolean | false | | User set is true if the user has set their own quiet hours schedule. If false, the user is using the default schedule. |
| Name | Type | Required | Restrictions | Description |
| -------------- | ------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `next` | string | false | | Next is the next time that the quiet hours window will start. |
| `raw_schedule` | string | false | | |
| `time` | string | false | | Time is the time of day that the quiet hours window starts in the given Timezone each day. |
| `timezone` | string | false | | raw format from the cron expression, UTC if unspecified |
| `user_can_set` | boolean | false | | User can set is true if the user is allowed to set their own quiet hours schedule. If false, the user cannot set a custom schedule and the default schedule will always be used. |
| `user_set` | boolean | false | | User set is true if the user has set their own quiet hours schedule. If false, the user is using the default schedule. |
## codersdk.UserStatus