Skip to content

[Server] Require schema creation permission for model rename - #2018

Merged
yili-db merged 4 commits into
unitycatalog:mainfrom
timothyw553:fix/model-rename-permissions
Oct 29, 2026
Merged

yili-db merged 4 commits into
unitycatalog:mainfrom
timothyw553:fix/model-rename-permissions

Conversation

@timothyw553

@timothyw553 timothyw553 commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added or modified a feature, documentation in docs is updated

Description of changes

Require permission to create models in the containing schema before renaming a model. Check any request with new_name, including the current name. Comment-only updates keep the existing checks.

server.authorization.strict-privilege-checks=false keeps the old behavior.

Tests: 22 focused tests and formatting passed.

@timothyw553
timothyw553 force-pushed the fix/model-rename-permissions branch from 037dbfc to 6ebe9e2 Compare October 19, 2026 18:57
@timothyw553
timothyw553 force-pushed the fix/model-rename-permissions branch 7 times, most recently from 6ab256d to 49d68ec Compare October 21, 2026 19:33
yili-db pushed a commit that referenced this pull request Oct 22, 2026
## 🥞 Stacked PR
Use this
[link](https://github.com/unitycatalog/unitycatalog/pull/2023/files) to
review incremental changes.
-
[**feat/strict-privilege-checks**](#2023)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2023/files)]
← _this PR_
-
[fix/iceberg-credential-authorization](#2015)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2015/files/d63e70154a6f21c4d23d596491c779b66a250367..1e627b250bb34d8df390f050d8307fd5442dddc6)]
-
[fix/model-rename-permissions](#2018)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2018/files/d63e70154a6f21c4d23d596491c779b66a250367..49d68ec662b2f29c588c8f5d67ec74cfc3fe017f)]
-
[fix/permission-grant-validation](#2014)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2014/files/d63e70154a6f21c4d23d596491c779b66a250367..c6a5d3bf21127e62fc81b2b291ea54bb56463b55)]
-
[fix/table-details-permissions](#2016)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2016/files/d63e70154a6f21c4d23d596491c779b66a250367..6c897e034918a99ea3a2c4bdbeac64905c8f9d93)]
-
[fix/volume-rename-permissions](#2017)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2017/files/d63e70154a6f21c4d23d596491c779b66a250367..0ad5aee5216d2ed8085e969c287cc7dee7cdfa98)]

---------
**PR Checklist**

- [x] A description of the changes is added to the description of this
PR.
- [x] If there is a related issue, make sure it is linked to this PR.
- [x] If you've fixed a bug or added code that should be tested, add
tests!
- [x] If you've added or modified a feature, documentation in `docs` is
updated

**Description of changes**

Add `server.authorization.strict-privilege-checks`, which defaults to
`true`.
The following permission fixes use this setting so deployments can keep
the previous rules
temporarily while updating their applications and grants. Setting it to
`false` retains the
previous behavior, including access that the corrected checks would
deny.

This PR adds the validated setting and passes it to authorization
expressions as the trusted
`#strict_privilege_checks` variable. Request values cannot change it.
The setting also reaches
response filtering through the shared evaluator. This base PR does not
change permission decisions.

Use the same value on every server instance and restart each instance
after changing it.
The fallback conditions and the setting can be deleted after the
migration.

Tests passed with JDK 17:

```sh
build/sbt javafmtAll "server/testOnly io.unitycatalog.server.utils.ServerPropertiesTest io.unitycatalog.server.UnityCatalogServerTest"
build/sbt "server/testOnly io.unitycatalog.server.auth.decorator.UnityAccessEvaluatorTest"
```

33 tests passed.

Combined validation with all five dependent fixes:
`build/sbt -J-Xmx2G javafmtAll "server/test"`: 923 tests passed.

Signed-off-by: Timothy Wang <[email protected]>
@timothyw553
timothyw553 force-pushed the fix/model-rename-permissions branch 3 times, most recently from 4fb0fcd to ccfd8fb Compare October 22, 2026 18:26
@yili-db

yili-db commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

/review

@yili-db

yili-db commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

This is the same pattern of #2017. Will wait for review of #2017 to finish first.

@timothyw553
timothyw553 force-pushed the fix/model-rename-permissions branch from ccfd8fb to 801cd02 Compare October 23, 2026 18:46
@yili-db

yili-db commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

/review

@timothyw553
timothyw553 force-pushed the fix/model-rename-permissions branch from 801cd02 to d34d9d9 Compare October 28, 2026 18:49
@timothyw553

Copy link
Copy Markdown
Collaborator Author

/review

1 similar comment
@timothyw553

Copy link
Copy Markdown
Collaborator Author

/review

@yili-db yili-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] The authorization change looks right and lines up with how #2017 landed (inline check, no same-name exemption). Two comments inline. Also, this now conflicts with main: #2017 added the "Volume rename" bullet to the same list in auth.md, so it needs a rebase.

*/
public class SdkModelAccessControlCRUDTest extends SdkAccessControlBaseCRUDTest {

@ParameterizedTest

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] Can we switch this to a plain @Test with a helper and loops, the same way testVolumeRenamePermissions ended up in #2017? The expected outcomes follow the same rules as volumes, plus one more loop over CREATE_MODEL / CREATE_FUNCTION. It's easier to read than positional CSV rows, and it covers combinations these rows skip, e.g. a catalog owner with USE SCHEMA but no create grant (the case that shows catalog owners also need the create grant), or a catalog owner with a catalog-level create grant. The legacy test can stay as CSV, like SdkVolumeRenameLegacyAccessControlTest.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, switched to loops like #2017. this also covers the missing catalog owner cases.

Comment thread docs/server/auth.md Outdated
- Table metadata: `MODIFY` no longer substitutes for `SELECT` for table details, listings,
and existence checks across the UC REST, Delta, and Iceberg REST APIs. Existing usage and
ownership rules still apply.
- Model rename: Requests with `new_name` must pass the existing update checks. The caller

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] nit: "on it" reads as if the create grant has to be on the schema, but a catalog-level grant also works (the tests cover that), and "Catalog ownership does not replace these schema permissions" can be read as catalog grants not counting. Could this match the volume bullet, e.g. "Model rename: Also require permission to create models in the containing schema."?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, shortened it to match the volume bullet.

@timothyw553
timothyw553 force-pushed the fix/model-rename-permissions branch from ca3b027 to 0db1527 Compare October 28, 2026 23:03
@yili-db

yili-db commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

/review

@yili-db
yili-db merged commit d625e77 into unitycatalog:main Oct 29, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants