Skip to content

Commit

Permalink
feat: Add Manage Warehouses Account Grant (#2017)
Browse files Browse the repository at this point in the history
* feat: Add Manage Warehouses Account Grant

* feat: Add Manage Warehouses Account Grant

---------

Co-authored-by: Artur Sawicki <[email protected]>
  • Loading branch information
GtheSheep and sfc-gh-asawicki authored Oct 3, 2023
1 parent 038241c commit 89c7148
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/resources/account_grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var validAccountPrivileges = NewPrivilegeSet(
privilegeExecuteTask,
privilegeImportShare,
privilegeManageGrants,
privilegeManageWarehouses,
privilegeMonitor,
privilegeMonitorUsage,
privilegeMonitorExecution,
Expand Down
17 changes: 17 additions & 0 deletions pkg/resources/account_grant_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,23 @@ func TestAcc_AccountGrantManageSupportCases(t *testing.T) {
})
}

func TestAcc_AccountGrantManageWarehouses(t *testing.T) {
roleName := strings.ToUpper(acctest.RandStringFromCharSet(10, acctest.CharSetAlpha))

resource.ParallelTest(t, resource.TestCase{
Providers: providers(),
CheckDestroy: nil,
Steps: []resource.TestStep{
{
Config: accountGrantConfig(roleName, "MANAGE WAREHOUSES"),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("snowflake_account_grant.test", "privilege", "MANAGE WAREHOUSES"),
),
},
},
})
}

func accountGrantConfig(role, privilege string) string {
return fmt.Sprintf(`
Expand Down
1 change: 1 addition & 0 deletions pkg/resources/privileges.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const (
privilegeImportShare Privilege = "IMPORT SHARE"
privilegeInsert Privilege = "INSERT"
privilegeManageGrants Privilege = "MANAGE GRANTS"
privilegeManageWarehouses Privilege = "MANAGE WAREHOUSES"
privilegeModify Privilege = "MODIFY"
privilegeMonitor Privilege = "MONITOR"
privilegeMonitorExecution Privilege = "MONITOR EXECUTION"
Expand Down
2 changes: 2 additions & 0 deletions pkg/sdk/privileges.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ const (
GlobalPrivilegeImportShare GlobalPrivilege = "IMPORT SHARE"
// | MANAGE GRANTS
GlobalPrivilegeManageGrants GlobalPrivilege = "MANAGE GRANTS"
// | MANAGE WAREHOUSES
GlobalPrivilegeManageWarehouses GlobalPrivilege = "MANAGE WAREHOUSES"

// | MODIFY { LOG LEVEL | TRACE LEVEL | SESSION LOG LEVEL | SESSION TRACE LEVEL }
GlobalPrivilegeModifyLogLevel GlobalPrivilege = "MODIFY LOG LEVEL"
Expand Down

0 comments on commit 89c7148

Please sign in to comment.