public function isAllowed(AccessControl $accessControl, Request $request) { if ($request->attributes->get('_route') !== $this->routeName) { return true; } return $accessControl->isLoggedIn(); }
public function isAllowed(AccessControl $accessControl, Request $request) { $routeName = $request->attributes->get('_route'); if (strpos($routeName, $this->routePrefix) !== 0) { return true; } if (in_array($routeName, $this->whitelistedRoutes)) { return true; } return $accessControl->isLoggedIn(); }