Conversation
The API access tier a user held was split across two fields that behaved differently and neither documented the difference: User.api_access_tier set the gateway's ruleset, while UserDataAccess.api_access_tier was read only on project-scoped rows and was inert everywhere else. A project-scoped row and a base tier granted overlapping but unequal access, and the model's help text described an "exceeds the user's base tier" comparison that no code implemented. UserApiAccess replaces both. A user with no row is restricted; a row with no project is global; a row with a project applies to that project; the most permissive applicable level wins, so a project grant can only widen a global one. There is no stored `restricted` level, because a grant conferring it would be indistinguishable from having no grant. UserDataAccess goes back to being purely a read whitelist (view_user_data / view_deanonymized_data), unrelated to API tiers. The serializer keeps emitting `api_access_tier` and `project_data_access` unchanged, so this works against the currently deployed gateway with no coordinated release. The data migration maps a global `benchmarking` tier to a grant scoped to the benchmarking project rather than a global grant, because that tier only ever unlocked that one project; `unrestricted` stays global. Inert tiers (on post-scoped or unscoped whitelist rows) are deliberately not carried over. Verified live against the gateway: field visibility under a project-scoped benchmarking grant is identical to the old global benchmarking tier, and a project grant correctly does not leak to other projects. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KpPsEyn1D9Yc6GhS7NA8pu
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
🚀 Preview EnvironmentYour preview environment is ready!
Details
ℹ️ Preview Environment InfoIsolation:
Limitations:
Cleanup:
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The API access tier a user held was split across two fields that behaved differently and neither documented the difference: User.api_access_tier set the gateway's ruleset, while UserDataAccess.api_access_tier was read only on project-scoped rows and was inert everywhere else. A project-scoped row and a base tier granted overlapping but unequal access, and the model's help text described an "exceeds the user's base tier" comparison that no code implemented.
UserApiAccess replaces both. A user with no row is restricted; a row with no project is global; a row with a project applies to that project; the most permissive applicable level wins, so a project grant can only widen a global one. There is no stored
restrictedlevel, because a grant conferring it would be indistinguishable from having no grant.UserDataAccess goes back to being purely a read whitelist (view_user_data / view_deanonymized_data), unrelated to API tiers.
The serializer keeps emitting
api_access_tierandproject_data_accessunchanged, so this works against the currently deployed gateway with no coordinated release.The data migration maps a global
benchmarkingtier to a grant scoped to the benchmarking project rather than a global grant, because that tier only ever unlocked that one project;unrestrictedstays global. Inert tiers (on post-scoped or unscoped whitelist rows) are deliberately not carried over.Verified live against the gateway: field visibility under a project-scoped benchmarking grant is identical to the old global benchmarking tier, and a project grant correctly does not leak to other projects.
Claude-Session: https://claude.ai/code/session_01KpPsEyn1D9Yc6GhS7NA8pu