Skip to content

Allow navigation to build when no ACL is present - #37

Merged
tyrsson merged 1 commit into
1.0.xfrom
tyrsson-navigation-without-acl
Nov 12, 2026
Merged

tyrsson merged 1 commit into
1.0.xfrom
tyrsson-navigation-without-acl

Conversation

@tyrsson

@tyrsson tyrsson commented Nov 12, 2026

Copy link
Copy Markdown
Member

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 navigation view helper.

Changes

  • NavigationFilterIterator: and are 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 UserInterface annotation in __invoke() was removed because it claimed a non-null user.
  • View\Helper\NavigationFactory: passes null when no AclInterface service is registered instead of demanding it.
  • Http\Middleware\NavigationMiddleware is untouched; it already guards its ACL fetch with instanceof.

Tests

New unit tests cover:

  • With no ACL, every route naming the requested nav id is accepted.
  • With no ACL, a route naming another nav id is rejected.
  • With an ACL present, allow and deny behavior is unchanged.
  • The factory resolves the helper when no AclInterface is registered.

Gates

Unit and integration suites pass; mago format, lint and analyze are clean; composer validate is valid.

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

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tyrsson
tyrsson merged commit 14b4444 into 1.0.x Nov 12, 2026
12 checks passed
@tyrsson
tyrsson deleted the tyrsson-navigation-without-acl branch November 12, 2026 09:14
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.

1 participant