Clean up useUser role surface: add hasRole, remove userKind, migrate call sites#14769
Open
rtibblesbot wants to merge 9 commits into
Open
Clean up useUser role surface: add hasRole, remove userKind, migrate call sites#14769rtibblesbot wants to merge 9 commits into
rtibblesbot wants to merge 9 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rTypeDisplay Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…SideNav Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…earningFooter, StorageNotification Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
npm Package VersionsWarning The following packages have changed files but no version bump:
If these changes affect published code, consider bumping the version. |
Contributor
Build Artifacts
Smoke test screenshot |
Sorry, got over excited - I'll do some manual testing before we merge.
Contributor
Author
|
Thanks for the review, @rtibbles! |
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.
Summary
Adds
hasRoletouseUser, removesuserKind, and migrates all call sites off the patterns in #14758.One intentional behaviour change:
!isLearnerprivilege gates becomehasRole, which no longer matches anonymous sessions (previously, anonymous visitors could satisfy!isLearner).References
Closes #14758
Reviewer guidance
The
isAdmin || isSuperuser→isAdminsimplifications inNotificationsRootandSideNavrely onisAdminalready covering superusers — confirmed atuseUser.js:78whereisAdminchecks forUserKinds.SUPERUSERexplicitly.StorageNotification.vueretains two positiveisLearnerchecks (lines 129, 137) — only the negated gate moved tohasRole.AI usage
Implemented with Claude Code following a pre-written plan. I verified the
isAdminincludes-superuser assumption by readinguseUser.js:78before simplifyingisAdmin || isSuperuserpatterns, and ran the full test suite for all affected packages.@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?