src/mako/http/routing/traits/AuthorizationTrait.php
protected function authorize(string $action, $entity): void
	{
		if($this->authorizer->can($this->gatekeeper->getUser(), $action, $entity) === false)
		{
			throw new ForbiddenException;
		}
	}
protected function authorize(string $action, $entity): void
	{
		if($this->authorizer->can($this->gatekeeper->getUser(), $action, $entity) === false)
		{
			throw new ForbiddenException;
		}
	}
protected function authorize ( string $ action , $ entity ) : void { if ( $ this -> authorizer -> can ( $ this -> gatekeeper -> getUser ( ) , $ action , $ entity ) === false ) { throw new ForbiddenException ; } }
Throws a ForbiddenException if the user is not allowed to perform the action on the entity.

@param  string                                   $action Action
@param  object|string                            $entity Entity instance or class name
@throws \mako\http\exceptions\ForbiddenException
Throws a ForbiddenException if the user is not allowed to perform the action on the entity .