Skip to content

Commit 679a42c

Browse files
Remove AddPlacementGroups user grant (#810)
* Remove AddPlacementGroups user grant * golangci-lint fmt * Remove from unit test
1 parent c74cc4d commit 679a42c

11 files changed

+17
-27
lines changed

account_user_grants.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ type GlobalUserGrants struct {
2020
AddLinodes bool `json:"add_linodes"`
2121
AddLongview bool `json:"add_longview"`
2222
AddNodeBalancers bool `json:"add_nodebalancers"`
23-
AddPlacementGroups bool `json:"add_placement_groups"`
2423
AddStackScripts bool `json:"add_stackscripts"`
2524
AddVolumes bool `json:"add_volumes"`
2625
AddVPCs bool `json:"add_vpcs"`

test/integration/account_user_grants_test.go

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,18 @@ func TestUserGrants_Update(t *testing.T) {
2323
accessLevel := linodego.AccessLevelReadOnly
2424

2525
globalGrants := linodego.GlobalUserGrants{
26-
AccountAccess: &accessLevel,
27-
AddDomains: false,
28-
AddDatabases: true,
29-
AddFirewalls: true,
30-
AddImages: true,
31-
AddLinodes: false,
32-
AddLongview: true,
33-
AddNodeBalancers: false,
34-
AddPlacementGroups: false,
35-
AddStackScripts: true,
36-
AddVolumes: true,
37-
AddVPCs: true,
38-
CancelAccount: false,
26+
AccountAccess: &accessLevel,
27+
AddDomains: false,
28+
AddDatabases: true,
29+
AddFirewalls: true,
30+
AddImages: true,
31+
AddLinodes: false,
32+
AddLongview: true,
33+
AddNodeBalancers: false,
34+
AddStackScripts: true,
35+
AddVolumes: true,
36+
AddVPCs: true,
37+
CancelAccount: false,
3938
}
4039

4140
grants, err := client.UpdateUserGrants(context.TODO(), username, linodego.UserGrantsUpdateOptions{

test/integration/fixtures/TestUserGrants_Update.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ interactions:
6565
code: 200
6666
duration: ""
6767
- request:
68-
body: '{"global":{"account_access":"read_only","add_databases":true,"add_domains":false,"add_firewalls":true,"add_images":true,"add_linodes":false,"add_longview":true,"add_nodebalancers":false,"add_placement_groups":false,"add_stackscripts":true,"add_volumes":true,"add_vpcs":true,"cancel_account":false,"child_account_access":false,"longview_subscription":false}}'
68+
body: '{"global":{"account_access":"read_only","add_databases":true,"add_domains":false,"add_firewalls":true,"add_images":true,"add_linodes":false,"add_longview":true,"add_nodebalancers":false,"add_stackscripts":true,"add_volumes":true,"add_vpcs":true,"cancel_account":false,"child_account_access":false,"longview_subscription":false}}'
6969
form: {}
7070
headers:
7171
Accept:

test/integration/fixtures/TestUserGrants_UpdateNoAccess.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ interactions:
6565
code: 200
6666
duration: ""
6767
- request:
68-
body: '{"global":{"account_access":null,"add_databases":false,"add_domains":false,"add_firewalls":false,"add_images":false,"add_linodes":false,"add_longview":false,"add_nodebalancers":false,"add_placement_groups":false,"add_stackscripts":false,"add_volumes":false,"add_vpcs":false,"cancel_account":false,"child_account_access":false,"longview_subscription":false}}'
68+
body: '{"global":{"account_access":null,"add_databases":false,"add_domains":false,"add_firewalls":false,"add_images":false,"add_linodes":false,"add_longview":false,"add_nodebalancers":false,"add_stackscripts":false,"add_volumes":false,"add_vpcs":false,"cancel_account":false,"child_account_access":false,"longview_subscription":false}}'
6969
form: {}
7070
headers:
7171
Accept:

test/integration/vpc_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ import (
66
"strings"
77
"testing"
88

9-
"github.com/stretchr/testify/require"
10-
119
"github.com/linode/linodego"
1210
. "github.com/linode/linodego"
11+
"github.com/stretchr/testify/require"
1312
)
1413

1514
type vpcModifier func(*linodego.Client, *linodego.VPCCreateOptions)

test/unit/account_user_grants_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ func TestAccountUserGrants_Get(t *testing.T) {
6464
assert.Equal(t, true, grants.Global.AddLinodes)
6565
assert.Equal(t, true, grants.Global.AddLongview)
6666
assert.Equal(t, true, grants.Global.AddNodeBalancers)
67-
assert.Equal(t, true, grants.Global.AddPlacementGroups)
6867
assert.Equal(t, true, grants.Global.AddStackScripts)
6968
assert.Equal(t, true, grants.Global.AddVolumes)
7069
assert.Equal(t, true, grants.Global.AddVPCs)
@@ -135,7 +134,6 @@ func TestAccountGrants_Update(t *testing.T) {
135134
assert.Equal(t, true, grants.Global.AddLinodes)
136135
assert.Equal(t, true, grants.Global.AddLongview)
137136
assert.Equal(t, true, grants.Global.AddNodeBalancers)
138-
assert.Equal(t, true, grants.Global.AddPlacementGroups)
139137
assert.Equal(t, true, grants.Global.AddStackScripts)
140138
assert.Equal(t, true, grants.Global.AddVolumes)
141139
assert.Equal(t, true, grants.Global.AddVPCs)

test/unit/fixtures/account_user_grants_get.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"add_linodes": true,
3030
"add_longview": true,
3131
"add_nodebalancers": true,
32-
"add_placement_groups": true,
3332
"add_stackscripts": true,
3433
"add_volumes": true,
3534
"add_vpcs": true,

test/unit/fixtures/account_user_grants_update.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"add_linodes": true,
3030
"add_longview": true,
3131
"add_nodebalancers": true,
32-
"add_placement_groups": true,
3332
"add_stackscripts": true,
3433
"add_volumes": true,
3534
"add_vpcs": true,

test/unit/fixtures/profile_grants_list.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"add_linodes": true,
3030
"add_longview": true,
3131
"add_nodebalancers": true,
32-
"add_placement_groups": true,
3332
"add_stackscripts": true,
3433
"add_volumes": true,
3534
"add_vpcs": true,

test/unit/interface_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ import (
44
"context"
55
"testing"
66

7-
"github.com/stretchr/testify/require"
8-
97
"github.com/linode/linodego"
108
"github.com/stretchr/testify/assert"
9+
"github.com/stretchr/testify/require"
1110
)
1211

1312
func TestInterface_Get(t *testing.T) {

0 commit comments

Comments
 (0)