Fix grants for former owners after owner change#174
Fix grants for former owners after owner change#174nettrash merged 3 commits intonettrash:v1.0.18from
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes grant/ACL diffing when object ownership changes by filtering implicit-owner grantees per side (FROM vs TO) rather than removing both owners globally, ensuring explicit TO grants for a former owner are preserved.
Changes:
- Update ACL diffing to accept
from_ownersandto_ownersand skip owner grantees only on the side where they are owners. - Thread side-specific owner context through grant generation in
Comparer::compare_grantsfor multiple object types (schemas, relations, routines, types, columns). - Add regression tests covering explicit grants to a former owner after ownership changes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
app/src/dump/acl.rs |
Adds side-specific owner filtering to ACL diffing and extends unit tests for former-owner grants. |
app/src/comparer/core.rs |
Passes from_owners/to_owners into grant generation across object types. |
app/src/comparer/core_tests.rs |
Adds an integration-style regression test reproducing issue #173 behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
669324d to
d96ed88
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Root cause
diff_aclspreviously removed FROM and TO owners from the merged grantee set. When ownership changed, this incorrectly suppressed explicit grants to the former owner in the TO database.Closes #173