docs: update template acl example params (#8320)

Param examples were unhelpful
This commit is contained in:
Steven Masley
2023-07-05 17:24:21 +00:00
committed by GitHub
parent 4a008a8f34
commit 418c9b8743
5 changed files with 39 additions and 16 deletions
+10
View File
@@ -9377,15 +9377,25 @@ const docTemplate = `{
"type": "object",
"properties": {
"group_perms": {
"description": "GroupPerms should be a mapping of group id to role.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/codersdk.TemplateRole"
},
"example": {
"8bd26b20-f3e8-48be-a903-46bb920cf671": "use",
"\u003cuser_id\u003e\u003e": "admin"
}
},
"user_perms": {
"description": "UserPerms should be a mapping of user id to role. The user id must be the\nuuid of the user, not a username or email address.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/codersdk.TemplateRole"
},
"example": {
"4df59e74-c027-470b-ab4d-cbba8963a5e9": "use",
"\u003cgroup_id\u003e": "admin"
}
}
}
+10
View File
@@ -8468,15 +8468,25 @@
"type": "object",
"properties": {
"group_perms": {
"description": "GroupPerms should be a mapping of group id to role.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/codersdk.TemplateRole"
},
"example": {
"8bd26b20-f3e8-48be-a903-46bb920cf671": "use",
"\u003cuser_id\u003e\u003e": "admin"
}
},
"user_perms": {
"description": "UserPerms should be a mapping of user id to role. The user id must be the\nuuid of the user, not a username or email address.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/codersdk.TemplateRole"
},
"example": {
"4df59e74-c027-470b-ab4d-cbba8963a5e9": "use",
"\u003cgroup_id\u003e": "admin"
}
}
}
+5 -2
View File
@@ -85,8 +85,11 @@ type TemplateUser struct {
}
type UpdateTemplateACL struct {
UserPerms map[string]TemplateRole `json:"user_perms,omitempty"`
GroupPerms map[string]TemplateRole `json:"group_perms,omitempty"`
// UserPerms should be a mapping of user id to role. The user id must be the
// uuid of the user, not a username or email address.
UserPerms map[string]TemplateRole `json:"user_perms,omitempty" example:"<group_id>:admin,4df59e74-c027-470b-ab4d-cbba8963a5e9:use"`
// GroupPerms should be a mapping of group id to role.
GroupPerms map[string]TemplateRole `json:"group_perms,omitempty" example:"<user_id>>:admin,8bd26b20-f3e8-48be-a903-46bb920cf671:use"`
}
type UpdateTemplateMeta struct {
+4 -4
View File
@@ -1080,12 +1080,12 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{template}/acl \
```json
{
"group_perms": {
"property1": "admin",
"property2": "admin"
"8bd26b20-f3e8-48be-a903-46bb920cf671": "use",
"<user_id>>": "admin"
},
"user_perms": {
"property1": "admin",
"property2": "admin"
"4df59e74-c027-470b-ab4d-cbba8963a5e9": "use",
"<group_id>": "admin"
}
}
```
+10 -10
View File
@@ -4441,24 +4441,24 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
```json
{
"group_perms": {
"property1": "admin",
"property2": "admin"
"8bd26b20-f3e8-48be-a903-46bb920cf671": "use",
"<user_id>>": "admin"
},
"user_perms": {
"property1": "admin",
"property2": "admin"
"4df59e74-c027-470b-ab4d-cbba8963a5e9": "use",
"<group_id>": "admin"
}
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------------------ | ---------------------------------------------- | -------- | ------------ | ----------- |
| `group_perms` | object | false | | |
| » `[any property]` | [codersdk.TemplateRole](#codersdktemplaterole) | false | | |
| `user_perms` | object | false | | |
| » `[any property]` | [codersdk.TemplateRole](#codersdktemplaterole) | false | | |
| Name | Type | Required | Restrictions | Description |
| ------------------ | ---------------------------------------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| `group_perms` | object | false | | Group perms should be a mapping of group ID to role. |
| » `[any property]` | [codersdk.TemplateRole](#codersdktemplaterole) | false | | |
| `user_perms` | object | false | | User perms should be a mapping of user ID to role. The user ID must be the uuid of the user, not a username or email address. |
| » `[any property]` | [codersdk.TemplateRole](#codersdktemplaterole) | false | | |
## codersdk.UpdateUserPasswordRequest