Skip to content

Commit 418c9b8

Browse files
authored
docs: update template acl example params (#8320)
Param examples were unhelpful
1 parent 4a008a8 commit 418c9b8

File tree

5 files changed

+39
-16
lines changed

5 files changed

+39
-16
lines changed

coderd/apidoc/docs.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codersdk/templates.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,11 @@ type TemplateUser struct {
8585
}
8686

8787
type UpdateTemplateACL struct {
88-
UserPerms map[string]TemplateRole `json:"user_perms,omitempty"`
89-
GroupPerms map[string]TemplateRole `json:"group_perms,omitempty"`
88+
// UserPerms should be a mapping of user id to role. The user id must be the
89+
// uuid of the user, not a username or email address.
90+
UserPerms map[string]TemplateRole `json:"user_perms,omitempty" example:"<group_id>:admin,4df59e74-c027-470b-ab4d-cbba8963a5e9:use"`
91+
// GroupPerms should be a mapping of group id to role.
92+
GroupPerms map[string]TemplateRole `json:"group_perms,omitempty" example:"<user_id>>:admin,8bd26b20-f3e8-48be-a903-46bb920cf671:use"`
9093
}
9194

9295
type UpdateTemplateMeta struct {

docs/api/enterprise.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,12 +1080,12 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{template}/acl \
10801080
```json
10811081
{
10821082
"group_perms": {
1083-
"property1": "admin",
1084-
"property2": "admin"
1083+
"8bd26b20-f3e8-48be-a903-46bb920cf671": "use",
1084+
"<user_id>>": "admin"
10851085
},
10861086
"user_perms": {
1087-
"property1": "admin",
1088-
"property2": "admin"
1087+
"4df59e74-c027-470b-ab4d-cbba8963a5e9": "use",
1088+
"<group_id>": "admin"
10891089
}
10901090
}
10911091
```

docs/api/schemas.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4441,24 +4441,24 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
44414441
```json
44424442
{
44434443
"group_perms": {
4444-
"property1": "admin",
4445-
"property2": "admin"
4444+
"8bd26b20-f3e8-48be-a903-46bb920cf671": "use",
4445+
"<user_id>>": "admin"
44464446
},
44474447
"user_perms": {
4448-
"property1": "admin",
4449-
"property2": "admin"
4448+
"4df59e74-c027-470b-ab4d-cbba8963a5e9": "use",
4449+
"<group_id>": "admin"
44504450
}
44514451
}
44524452
```
44534453

44544454
### Properties
44554455

4456-
| Name | Type | Required | Restrictions | Description |
4457-
| ------------------ | ---------------------------------------------- | -------- | ------------ | ----------- |
4458-
| `group_perms` | object | false | | |
4459-
| » `[any property]` | [codersdk.TemplateRole](#codersdktemplaterole) | false | | |
4460-
| `user_perms` | object | false | | |
4461-
| » `[any property]` | [codersdk.TemplateRole](#codersdktemplaterole) | false | | |
4456+
| Name | Type | Required | Restrictions | Description |
4457+
| ------------------ | ---------------------------------------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------- |
4458+
| `group_perms` | object | false | | Group perms should be a mapping of group ID to role. |
4459+
| » `[any property]` | [codersdk.TemplateRole](#codersdktemplaterole) | false | | |
4460+
| `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. |
4461+
| » `[any property]` | [codersdk.TemplateRole](#codersdktemplaterole) | false | | |
44624462

44634463
## codersdk.UpdateUserPasswordRequest
44644464

0 commit comments

Comments
 (0)