Skip to content

Commit

Permalink
Extract MANAGE SHARE TARGET to enum
Browse files Browse the repository at this point in the history
References: #3153
  • Loading branch information
sfc-gh-asawicki committed Nov 7, 2024
1 parent 307366c commit 9888d49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestAcc_GrantPrivilegesToAccountRole_OnAccount_gh3153(t *testing.T) {
configVariables := config.Variables{
"name": config.StringVariable(roleFullyQualifiedName),
"privileges": config.ListVariable(
config.StringVariable("MANAGE SHARE TARGET"),
config.StringVariable(string(sdk.GlobalPrivilegeManageShareTarget)),
),
}
resourceName := "snowflake_grant_privileges_to_account_role.test"
Expand All @@ -99,9 +99,9 @@ func TestAcc_GrantPrivilegesToAccountRole_OnAccount_gh3153(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(resourceName, "account_role_name", roleFullyQualifiedName),
resource.TestCheckResourceAttr(resourceName, "privileges.#", "1"),
resource.TestCheckResourceAttr(resourceName, "privileges.0", "MANAGE SHARE TARGET"),
resource.TestCheckResourceAttr(resourceName, "privileges.0", string(sdk.GlobalPrivilegeManageShareTarget)),
resource.TestCheckResourceAttr(resourceName, "on_account", "true"),
resource.TestCheckResourceAttr(resourceName, "id", fmt.Sprintf("%s|false|false|MANAGE SHARE TARGET|OnAccount", roleFullyQualifiedName)),
resource.TestCheckResourceAttr(resourceName, "id", fmt.Sprintf("%s|false|false|%s|OnAccount", roleFullyQualifiedName, sdk.GlobalPrivilegeManageShareTarget)),
),
},
},
Expand Down
1 change: 1 addition & 0 deletions pkg/sdk/privileges.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const (
GlobalPrivilegeManageOrganizationSupportCases GlobalPrivilege = "MANAGE ORGANIZATION SUPPORT CASES"
GlobalPrivilegeManageUserSupportCases GlobalPrivilege = "MANAGE USER SUPPORT CASES"
GlobalPrivilegeManageWarehouses GlobalPrivilege = "MANAGE WAREHOUSES"
GlobalPrivilegeManageShareTarget GlobalPrivilege = "MANAGE SHARE TARGET"

GlobalPrivilegeModifyLogLevel GlobalPrivilege = "MODIFY LOG LEVEL"
GlobalPrivilegeModifyTraceLevel GlobalPrivilege = "MODIFY TRACE LEVEL"
Expand Down

0 comments on commit 9888d49

Please sign in to comment.