Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
hide add user option from overview page
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas D Hedding committed Aug 10, 2018
2 parents 937471e + 938c4c9 commit 09ac635
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Controller/OgAdminRoutesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ public function overview(RouteMatchInterface $route_match) {
$route_name = "entity.$entity_type_id.og_admin_routes.$name";
$parameters = [$entity_type_id => $group->id()];

// Don't list items that are intentionally hidden from the overview.
if (array_intersect_assoc(['_overview' => FALSE], $info)) {
continue;
}

// We don't use Url::fromRoute() here for the access check, as it will
// prevent us from unit testing this method.
if (!$this->accessManager->checkNamedRoute($route_name, $parameters)) {
Expand Down
1 change: 1 addition & 0 deletions src/EventSubscriber/OgEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ public function provideOgAdminRoutes(OgAdminRoutesEventInterface $event) {
'requirements' => [
'_og_user_access_group' => 'administer group',
],
'_overview' => FALSE,
];

$event->setRoutesInfo($routes_info);
Expand Down

0 comments on commit 09ac635

Please sign in to comment.