-
Notifications
You must be signed in to change notification settings - Fork 154
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
Allow managing project permissions #768
Conversation
ab1c7a0
to
0eeb874
Compare
24426b4
to
63e1bf0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far things are looking great. While smoke testing I uncovered a panic ⬇️
} | ||
|
||
func resourceTFETeamProjectAccessCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { | ||
tfeClient := meta.(*tfe.Client) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Panic ❗
tfeClient := meta.(*tfe.Client) | |
config := meta.(ConfiguredClient) | |
// you can use the tfe client: config.Client.Workspaces.Blah() |
This change was introduced in #762
In effect, organization
attributes are no longer required since you can configure the provider with a universal org.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops oops oops, I didn't realize I had pulled this in with a rebase. At it would have burned me in the merge anyway, so thanks for catching this! I applied that pattern to remove all usages of meta.(*tfe.Client)
.
func TestAccTFETeamProjectAccess_admin(t *testing.T) { | ||
skipUnlessBeta(t) | ||
|
||
tmAccess := &tfe.TeamProjectAccess{} | ||
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're going to need elevated privileges here, so createBusinessOrganization()
😄
Adds a new `manage_projects` attribute to team resource to allow giving teams permission to manage all projects in an org.
Allows giving teams admin or read permissions on specific projects.
Allows reading a team's access level to a workspace.
63e1bf0
to
18607c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got the chance to run a smoke test on your configuration example. It works!
When will it be available? |
We are also looking forward to have this available. |
@tkaburagi @cmicck This was released yesterday in provider version v0.42.0 |
Description
This adds support for managing a team's project permissions. It introduces a new resource called
tfe_team_project_access
to grant a team read or admin permission on a specific project, and adds a newmanage_projects
attribute on thetfe_team
resource to allow giving a team access to all projects in an org.Testing plan
External links
Output from acceptance tests
Please run applicable acceptance tests locally and include the output here. See TESTS.md to learn how to run acceptance tests.
If you are an external contributor, your contribution(s) will first be reviewed before running them against the project's CI pipeline.
Ran with ENABLE_BETA=1