Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jeff Bonhag <[email protected]>
  • Loading branch information
rberecka and jbonhag authored Jul 26, 2023
1 parent d423935 commit 0844942
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Added BETA support for including `projects` relationship and `projects-count` attribute to policy_set on create by @hs26gill [#737](https://github.com/hashicorp/go-tfe/pull/737)
* Added BETA method `AddProjects` and `RemoveProjects` for attaching/detaching policy set to projects by @Netra2104 [#735](https://github.com/hashicorp/go-tfe/pull/735)
* Added BETA support for adding and updating custom permissions to `TeamProjectAccesses`. A `TeamProjectAccessType` of `"custom"` can set various permissions applied at
the project level to the project itself (`ProjectAccessOptions`) and all of the workspaces in a project (`WorkspaceAccessOptions`).[#745](https://github.com/hashicorp/go-tfe/pull/745)
the project level to the project itself (`ProjectAccessPermissionsOptions`) and all of the workspaces in a project (`WorkspaceAccessPermissionsOptions`).[#745](https://github.com/hashicorp/go-tfe/pull/745)

# v1.30.0

Expand Down
3 changes: 2 additions & 1 deletion team_project_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ type TeamProjectAccess struct {
Project *Project `jsonapi:"relation,project"`
}

// ProjectPermissions represents the team's permissions on its project
// ProjectAccessPermissions represents the team's specific permissions related to the project itself
type ProjectAccessPermissions struct {
ProjectSettingsPermission ProjectSettingsPermissionType `jsonapi:"attr,settings"`
ProjectTeamsPermission ProjectTeamsPermissionType `jsonapi:"attr,teams"`
}

// WorkspaceAccessPermissions represents the team's specific permissions related to workspaces in the project
type WorkspaceAccessPermissions struct {
WorkspaceRunsPermission WorkspaceRunsPermissionType `jsonapi:"attr,runs"`
WorkspaceSentinelMocksPermission WorkspaceSentinelMocksPermissionType `jsonapi:"attr,sentinel-mocks"`
Expand Down
4 changes: 2 additions & 2 deletions team_project_access_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,13 @@ func TestTeamProjectAccessesUpdate(t *testing.T) {
tm2Test, tm2TestCleanup := createTeam(t, client, orgTest)
defer tm2TestCleanup()

TpaOptions := TeamProjectAccessAddOptions{
tpaOptions := TeamProjectAccessAddOptions{
Access: *ProjectAccess(TeamProjectAccessCustom),
Team: tm2Test,
Project: pTest,
}

tpaCustomTest, err := client.TeamProjectAccess.Add(ctx, TpaOptions)
tpaCustomTest, err := client.TeamProjectAccess.Add(ctx, tpaOptions)
require.NoError(t, err)

skipUnlessBeta(t)
Expand Down

0 comments on commit 0844942

Please sign in to comment.