-
Notifications
You must be signed in to change notification settings - Fork 40
fix: skip privileges for ignored objects in .pgschemaignore (#392) #393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2121,6 +2121,11 @@ func (i *Inspector) buildPrivileges(ctx context.Context, schema *IR, targetSchem | |
| continue | ||
| } | ||
|
|
||
| // Skip privileges for ignored objects (e.g., ignored functions should have their privileges ignored too) | ||
| if i.ignoreConfig != nil && i.ignoreConfig.ShouldIgnorePrivilegeByObjectType(objectName, objectType) { | ||
| continue | ||
| } | ||
|
|
||
| // Check for default PUBLIC grants that should be excluded | ||
| if grantee == "PUBLIC" { | ||
| if (objectType == "FUNCTION" || objectType == "PROCEDURE") && privilegeType == "EXECUTE" { | ||
|
|
@@ -2216,6 +2221,11 @@ func (i *Inspector) buildRevokedDefaultPrivileges(ctx context.Context, targetSch | |
| objectName := row.ObjectName.String | ||
| objectType := row.ObjectType.String | ||
|
|
||
| // Skip revoked default privileges for ignored objects | ||
| if i.ignoreConfig != nil && i.ignoreConfig.ShouldIgnorePrivilegeByObjectType(objectName, objectType) { | ||
| continue | ||
| } | ||
|
|
||
| var objType PrivilegeObjectType | ||
| var privs []string | ||
| switch objectType { | ||
|
|
@@ -2470,6 +2480,11 @@ func (i *Inspector) buildColumnPrivileges(ctx context.Context, schema *IR, targe | |
| continue | ||
| } | ||
|
|
||
| // Skip column privileges for ignored tables/views | ||
| if i.ignoreConfig != nil && (i.ignoreConfig.ShouldIgnoreTable(tableName) || i.ignoreConfig.ShouldIgnoreView(tableName)) { | ||
| continue | ||
| } | ||
|
Comment on lines
+2483
to
+2486
|
||
|
|
||
| key := colPrivKey{ | ||
| TableName: tableName, | ||
| Grantee: grantee, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.