Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

pterodactyl/panel

8314 stars
2 code files
View pterodactyl/panel on GitHub

app/Exceptions/Http/HttpForbiddenException.php

Open in GitHub
use Illuminate\Http\Response;
use Symfony\Component\HttpKernel\Exception\HttpException;
 
class HttpForbiddenException extends HttpException
{
public function __construct(string $message = null, \Throwable $previous = null)
{
parent::__construct(Response::HTTP_FORBIDDEN, $message, $previous);
}
}

app/Http/Controllers/Api/Client/Servers/WebsocketController.php#L58

Open in GitHub
use Pterodactyl\Exceptions\Http\HttpForbiddenException;
 
class WebsocketController extends ClientApiController
{
public function __invoke(ClientApiRequest $request, Server $server)
{
//
$permissions = $this->permissionsService->handle($server, $user);
//
if (!in_array('admin.websocket.transfer', $permissions)) {
throw new HttpForbiddenException('You do not have permission to view server transfer logs.');
}
//
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.