Skip to content

Commit

Permalink
Small fix to hasRequirement check. Cannot take a specific permissio…
Browse files Browse the repository at this point in the history
…n as a second parameter. We'll set the permission whenever one is not set.
  • Loading branch information
ryguyk committed Jan 6, 2025
1 parent 4ab5be0 commit eb6944c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class RouteSubscriber extends RouteSubscriberBase {
protected function alterRoutes(RouteCollection $collection) {
foreach ($collection->all() as $route_name => $route) {
if (strpos($route_name, 'va_gov_form_builder.') === 0) {
if (!$route->hasRequirement('_permission', 'access form builder')) {
if (!$route->hasRequirement('_permission')) {
$route->setRequirement('_permission', 'access form builder');
}
}
Expand Down

0 comments on commit eb6944c

Please sign in to comment.