Closed andrconstruction closed 7 years ago
By default, guards are attached to MvcEvent::EVENT_ROUTE
with priority -5
:
https://github.com/ZF-Commons/zfc-rbac/blob/v2.6.3/src/ZfcRbac/Guard/AbstractGuard.php#L36-L44, so if you want your listener to run before it, you just have to attach it with a higher priority.
Also make sure that your use-case can't be covered with a custom provider: https://github.com/ZF-Commons/zfc-rbac/blob/master/docs/03.%20Role%20providers.md
Hi. Can you advise me what should I do. I need to create an auth service for an api before guards start. What a priority of my listener should be or an event? Or how can I achieve this?