Repository navigation
fix: list pages contributed to admin.pages in the sidebar - #28
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Merged
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.
Closes #27.
Pages contributed to
admin.pageswere mounted as routes but never listed in the sidebar, althoughAdminPageRegistration.labelis documented as the sidebar label._layout.tsxaddsadminContext.pluginPagesto the nav items, in a "plugins" group (the layout already renders any non-core group). The existing permission filter hides an entry from anyone without the page'spermission.state.permissionsdid not have:computeNavPermissionsonly checks a fixed core list, so a custom permission likebilling.managewould have hidden the entry from everyone. It now takes the permissions the contributed pages declare as an extra argument, and the middleware passes them. A permission authz cannot evaluate counts as denied, so one bad plugin name cannot break every admin page; a core permission failing still throws.AdminState.permissionsandNavItem.permissionare now plain strings (a contributed page's permission is a plain string).iconis accepted but not rendered: the sidebar shows labels only, core items included. The doc comment says so.Tests: four new ones (shown with the permission / hidden without / only permitted pages / no empty "plugins" group; extra permissions checked once; an authz error on a custom permission is denied).
deno task checkclean, full suite 309 pass.Patch release material (4.0.1). Like 4.0.0 it needs the dependency-age escape flag until the window clears.
🤖 Generated with Claude Code