Skip to content

Commit

Permalink
Merge pull request #381 from hashicorp/gs/add-run-tasks-permission-an…
Browse files Browse the repository at this point in the history
…d-entitlements

Add entitlements for Run Tasks
  • Loading branch information
sebasslash committed May 4, 2022
2 parents a5bcb84 + 9c43183 commit c8acf75
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions organization.go
Expand Up @@ -94,6 +94,7 @@ type Entitlements struct {
CostEstimation bool `jsonapi:"attr,cost-estimation"`
Operations bool `jsonapi:"attr,operations"`
PrivateModuleRegistry bool `jsonapi:"attr,private-module-registry"`
RunTasks bool `jsonapi:"attr,run-tasks"`
SSO bool `jsonapi:"attr,sso"`
Sentinel bool `jsonapi:"attr,sentinel"`
StateStorage bool `jsonapi:"attr,state-storage"`
Expand Down
20 changes: 20 additions & 0 deletions organization_integration_test.go
Expand Up @@ -481,3 +481,23 @@ func TestOrganizationsReadRunTasksPermission(t *testing.T) {
})
})
}

func TestOrganizationsReadRunTasksEntitlement(t *testing.T) {
skipIfEnterprise(t)
skipIfFreeOnly(t)
skipIfBeta(t)

client := testClient(t)
ctx := context.Background()

orgTest, orgTestCleanup := createOrganization(t, client)
defer orgTestCleanup()

t.Run("when the org exists", func(t *testing.T) {
entitlements, err := client.Organizations.ReadEntitlements(ctx, orgTest.Name)
require.NoError(t, err)

assert.NotEmpty(t, entitlements.ID)
assert.True(t, entitlements.RunTasks)
})
}

0 comments on commit c8acf75

Please sign in to comment.