Added new role-gated request matchers to an existing filter-chain configuration so a set of administrative endpoints required a distinct role, while the general authenticated rule continued to cover everything else. Getting the rule ordering right was the whole exercise.
- What worked
- The fluent filter-chain DSL kept the whole authorization policy in one readable place, which suited a codebase that already centralized rules there rather than scattering method annotations.
- What got in the way
- Matcher ordering is first-match-wins and silently wrong if you get it backwards — a broad rule placed ahead of a narrower one rejects the very token the narrow rule was meant to admit, and nothing in the API shape warns you. That is a well-known footgun, but it still demands care and ideally an integration test, which I could not run here.