The documentation you are viewing is for an older version of this component.
Switch to the latest (v4) version.
The last step in order to use this package is to register the middleware.
This middleware triggers the authorization event.
You MUST insert this middleware between the routing middleware and the dispatch middleware of the application, because the guards need the RouteResult
in order to get the matched route and params.
//...
'routing' => [
'middleware' => [
ApplicationFactory::ROUTING_MIDDLEWARE,
//...
\Dot\Rbac\Guard\Middleware\RbacGuardMiddleware::class,
//...
ApplicationFactory::DISPATCH_MIDDLEWARE,
],
'priority' => 1,
],
//...