File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1262,12 +1262,24 @@ func (rp *RoleProcessor) syncRoleGrants(role Role) {
12621262 toAdd := difference (desired , current )
12631263 toRevoke := difference (current , desired )
12641264
1265- // Filter out OWNERSHIP grants (cannot be revoked, only transferred)
1265+ // Only revoke grants for object types this tool explicitly manages.
1266+ // Leave ROLE grants and any other unmanaged types alone.
1267+ managedObjectTypes := map [string ]struct {}{
1268+ "DATABASE" : {},
1269+ "SCHEMA" : {},
1270+ "TABLE" : {},
1271+ "VIEW" : {},
1272+ "WAREHOUSE" : {},
1273+ "WORKSPACE" : {},
1274+ }
12661275 filteredToRevoke := make (map [GrantKey ]struct {})
12671276 for gk := range toRevoke {
12681277 if strings .ToUpper (gk .Privilege ) == "OWNERSHIP" {
12691278 continue
12701279 }
1280+ if _ , managed := managedObjectTypes [strings .ToUpper (gk .ObjectType )]; ! managed {
1281+ continue
1282+ }
12711283 filteredToRevoke [gk ] = struct {}{}
12721284 }
12731285 toRevoke = filteredToRevoke
You can’t perform that action at this time.
0 commit comments