Repository navigation
Allow navigation to build when no ACL is present - #37
Merged
Merged
Conversation
NavigationFilterIterator now accepts a null ACL and a null user, accepting every route that names the requested nav id when the ACL is absent. The Navigation helper's ACL becomes nullable, and NavigationFactory tolerates an unregistered AclInterface service. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
webware-navigation can now build and render navigation when no ACL is present. A plain Mezzio app without authorization wiring, and any CLI process with no request, can use the
navigationview helper.Changes
NavigationFilterIterator:andare nullable.accept()returns true for a route that names the requested nav id when the ACL is null, and otherwise delegates to the ACL as before.belongsToNav()is unchanged, so a route naming a different nav id is still rejected.View\Helper\Navigation: the constructor ACL is now?AclInterface = null. The@var UserInterfaceannotation in__invoke()was removed because it claimed a non-null user.View\Helper\NavigationFactory: passes null when noAclInterfaceservice is registered instead of demanding it.Http\Middleware\NavigationMiddlewareis untouched; it already guards its ACL fetch withinstanceof.Tests
New unit tests cover:
AclInterfaceis registered.Gates
Unit and integration suites pass; mago format, lint and analyze are clean;
composer validateis valid.