add(new \Slim\Extras\Middleware\FeatherBBAuth()); * */ namespace FeatherBB\Middleware; use FeatherBB\Core\Error; use FeatherBB\Core\Interfaces\User; /** * Middleware to check if user is allowed to read the board */ class ReadBoard { public function __invoke($request, $response, $next) { // Display error page if (!User::can('board.read')) { throw new Error(__('No view'), 403); } $response = $next($request, $response); return $response; } }