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