Skip to content

Commit 85f4996

Browse files
Merge branch 'ceng-569-terraform-repo-privileges-safeguard' of github.com:cloudsmith-io/terraform-provider-cloudsmith into ceng-569-terraform-repo-privileges-safeguard
2 parents 94439aa + acda721 commit 85f4996

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cloudsmith/resource_repository_privileges.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func resourceRepositoryPrivilegesCreateUpdate(d *schema.ResourceData, m interfac
188188
privileges = append(privileges, expandRepositoryPrivilegeTeams(d)...)
189189
privileges = append(privileges, expandRepositoryPrivilegeUsers(d)...)
190190

191-
// Only hard error if the authenticated account is NOT present in any user/service block
191+
// Only return an error if the authenticated account is NOT present in any user/service block
192192
// AND there are NO team blocks defined. If team blocks are present, emit a warning only.
193193
userReq := pc.APIClient.UserApi.UserSelf(pc.Auth)
194194
userSelf, _, err := pc.APIClient.UserApi.UserSelfExecute(userReq)

docs/resources/repository_privileges.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ The repository privileges resource allows the management of privileges for a giv
44

55
Note that while users can be added to repositories in this manner, since Terraform does not (and cannot currently) manage those user accounts, you may encounter issues if the users change or are deleted outside of Terraform.
66

7-
> [!WARNING] Important: When a repository is first created in Cloudsmith the creating account (user or service account that owns the API key) is automatically granted an implicit Admin privilege.
8-
When you later manage privileges via this resource you must explicitly include that account (using a `user` or `service` block with the appropriate `slug`) or the provider will refuse to apply the change to prevent locking you out, you will still be able to apply changes if a `team` block is present, however, you must make sure that the account has sufficient permission within the team or lockout can still occur.
7+
> [!WARNING] Important: When a repository is first created in Cloudsmith, the creating account (user or service account that owns the API key) is automatically granted an implicit Admin privilege.
8+
When you later manage privileges via this resource, you must explicitly include that account (using a `user` or `service` block with the appropriate `slug`). Otherwise, the provider will refuse to apply the change to prevent locking you out. You will still be able to apply changes if a `team` block is present. However, you must make sure that the account has sufficient permission within the team, or lockout can still occur.
99

1010
See [docs.cloudsmith.com](https://docs.cloudsmith.com/repositories/repository-settings#repository-privileges) for full permissions documentation.
1111

0 commit comments

Comments
 (0)