Fix odiseoteam/sylius-rbac-plugin admin route prefix (#2046)

* Fix odiseoteam/sylius-rbac-plugin admin route prefix

The recipe hardcoded prefix: /admin, so on any install that customizes
SYLIUS_ADMIN_ROUTING_PATH_NAME the plugin's own admin routes land outside
sylius.security.admin_regex and are unreachable through the admin firewall.
Use the same parameterized prefix Sylius' own admin routes use.

Also trims the post-install note: the AdminUser snippet and the migration
command are already covered by the linked installation guide.

* Trigger CI
This commit is contained in:
Diego D'amico
2026-09-08 17:29:05 +04:00
committed by GitHub
parent 2833906142
commit 545f6e495a
2 changed files with 3 additions and 11 deletions
@@ -1,3 +1,3 @@
odiseo_sylius_rbac_admin:
resource: "@OdiseoSyliusRbacPlugin/config/routes/admin.yaml"
prefix: /admin
prefix: '/%sylius_admin.path_name%'
@@ -2,17 +2,9 @@
<bg=blue;fg=white> What's next? </>
<bg=blue;fg=white> </>
* <fg=blue>Make</> your AdminUser administration-role aware: add
<comment>AdministrationRoleAwareInterface</> and <comment>AdministrationRoleAwareTrait</>
to your <comment>AdminUser</> entity. This plugin cannot do it for you -- that class is
yours, and may already extend or implement other things.
* <fg=blue>Update</> your database schema:
<comment>bin/console doctrine:migrations:migrate</>
* <fg=blue>Read</> the full installation guide at
<comment>https://github.com/odiseoteam/SyliusRbacPlugin/blob/master/doc/installation.md</>
* <fg=blue>Grant</> yourself access. A fresh install denies every administrator
everything, including the screen that assigns roles:
<comment>bin/console odiseo:rbac:grant <username-or-email> super_admin --create</>
* <fg=blue>Read</> the full installation guide, including the AdminUser snippet, at
<comment>https://github.com/odiseoteam/SyliusRbacPlugin/blob/master/doc/installation.md</>