Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repository: add docs on how to create permissions #58

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/resources/hub_repository_team_permission.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ description: |-
~> Note When used with a Personal Access Token authentication (PAT), the PAT should
have the "Read, Write, and Delete" scope to create and delete team permissions. The
owner of the PAT must be an editor of the org.
Example Usage

resource "docker_hub_repository" "my_repo" {
namespace = "my-namespace"
name = "my-repo"
}

resource "docker_hub_repository_team_permission" "my_repo" {
repo_id = docker_hub_repository.my_repo.id
team_id = 123456
permission = "admin"
}
---

# docker_hub_repository_team_permission (Resource)
Expand All @@ -17,6 +29,21 @@ Grants team permissions to an image repository.
have the "Read, Write, and Delete" scope to create and delete team permissions. The
owner of the PAT must be an editor of the org.

## Example Usage

```hcl
resource "docker_hub_repository" "my_repo" {
namespace = "my-namespace"
name = "my-repo"
}

resource "docker_hub_repository_team_permission" "my_repo" {
repo_id = docker_hub_repository.my_repo.id
team_id = 123456
permission = "admin"
}
```



<!-- schema generated by tfplugindocs -->
Expand Down
16 changes: 16 additions & 0 deletions internal/provider/resource_repository_team_permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,22 @@ func (r *RepositoryTeamPermissionResource) Schema(ctx context.Context, req resou
~> **Note** When used with a Personal Access Token authentication (PAT), the PAT should
have the "Read, Write, and Delete" scope to create and delete team permissions. The
owner of the PAT must be an editor of the org.

## Example Usage

` + "```hcl" + `
resource "docker_hub_repository" "my_repo" {
namespace = "my-namespace"
name = "my-repo"
}

resource "docker_hub_repository_team_permission" "my_repo" {
repo_id = docker_hub_repository.my_repo.id
team_id = 123456
permission = "admin"
}
` + "```" + `

`,

Attributes: map[string]schema.Attribute{
Expand Down
Loading