Skip to content

Commit

Permalink
change after review
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jcieslak committed Jan 9, 2024
1 parent eacccb0 commit 7657134
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"database/sql"
"fmt"
"log"
"regexp"
"slices"
"testing"
Expand Down Expand Up @@ -775,7 +776,11 @@ func queriedPrivilegesEqualTo(databaseRoleName sdk.DatabaseObjectIdentifier, pri
return err
}
for _, grant := range grants {
if !slices.Contains(privileges, grant.Privilege) && grant.Privilege != "USAGE" && grant.Privilege != "OWNERSHIP" {
if grant.Privilege == "USAGE" || grant.Privilege == "OWNERSHIP" {
log.Printf("Skipping check for %s privilege as its one of the privileges that are implicitly granted by Snowflake", grant.Privilege)
continue
}
if !slices.Contains(privileges, grant.Privilege) {
return fmt.Errorf("grant not expected, grant: %v, not in %v", grants, privileges)
}
}
Expand Down

0 comments on commit 7657134

Please sign in to comment.