2021-08-05 04:36:57 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Requests\Api\Client;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\Permission;
|
2021-08-07 23:08:29 +00:00
|
|
|
use Illuminate\Auth\Access\AuthorizationException;
|
2021-08-05 04:36:57 +00:00
|
|
|
|
|
|
|
class WebsocketTokenRequest extends ClientApiRequest
|
|
|
|
{
|
|
|
|
public function permission(): string
|
|
|
|
{
|
|
|
|
return Permission::ACTION_WEBSOCKET_CONNECT;
|
|
|
|
}
|
2021-08-07 23:08:29 +00:00
|
|
|
|
|
|
|
protected function failedAuthorization()
|
|
|
|
{
|
|
|
|
throw new AuthorizationException('You do not have permission to connect to this server\'s websocket.');
|
|
|
|
}
|
2021-08-05 04:36:57 +00:00
|
|
|
}
|