Elgg  Version master
GroupToolGatekeeper.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Router\Middleware;
4 
7 
14 
20  public function __invoke(\Elgg\Request $request): void {
21  parent::__invoke($request);
22 
23  $group_tool = $request->getHttpRequest()?->getRoute()?->getOption('group_tool');
24  if (empty($group_tool)) {
25  return;
26  }
27 
28  _elgg_services()->gatekeeper->assertGroupToolEnabled($group_tool, $this->page_owner);
29  }
30 }
Generic HTTP exception.
Thrown when the requested group tool isn't enabled for a group.
Request container.
Definition: Request.php:12
Check if the current route has a page owner entity and it is a group.
Check if the current route has a group_tool configured and that the group tool is enabled for the (gr...
__invoke(\Elgg\Request $request)
{Validate the current request.the current requestvoid }
_elgg_services()
Get the global service provider.
Definition: elgglib.php:343
$request
Definition: livesearch.php:12