Fix inability to edit certain environment vars and start line, closes #1008
This commit is contained in:
parent
85bdbdce14
commit
070239abcf
2 changed files with 5 additions and 1 deletions
|
@ -8,6 +8,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
|
||||||
* Fixes a bug when reinstalling a server that would not mark the server as installing, resulting in some UI issues.
|
* Fixes a bug when reinstalling a server that would not mark the server as installing, resulting in some UI issues.
|
||||||
* Handle 404 errors from missing models in the application API bindings correctly.
|
* Handle 404 errors from missing models in the application API bindings correctly.
|
||||||
* Fix validation error returned when no environment variables are passed, even if there are no variables required.
|
* Fix validation error returned when no environment variables are passed, even if there are no variables required.
|
||||||
|
* Fix improper permissions on `PATCH /api/servers/<id>/startup` endpoint which was preventing enditing any start variables.
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
* Adds back client API for sending commands or power toggles to a server though the Panel API: `/api/client/servers/<identifier>`
|
* Adds back client API for sending commands or power toggles to a server though the Panel API: `/api/client/servers/<identifier>`
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace Pterodactyl\Http\Controllers\Api\Application\Servers;
|
namespace Pterodactyl\Http\Controllers\Api\Application\Servers;
|
||||||
|
|
||||||
|
use Pterodactyl\Models\User;
|
||||||
use Pterodactyl\Models\Server;
|
use Pterodactyl\Models\Server;
|
||||||
use Pterodactyl\Services\Servers\StartupModificationService;
|
use Pterodactyl\Services\Servers\StartupModificationService;
|
||||||
use Pterodactyl\Transformers\Api\Application\ServerTransformer;
|
use Pterodactyl\Transformers\Api\Application\ServerTransformer;
|
||||||
|
@ -40,7 +41,9 @@ class StartupController extends ApplicationApiController
|
||||||
*/
|
*/
|
||||||
public function index(UpdateServerStartupRequest $request): array
|
public function index(UpdateServerStartupRequest $request): array
|
||||||
{
|
{
|
||||||
$server = $this->modificationService->handle($request->getModel(Server::class), $request->validated());
|
$server = $this->modificationService
|
||||||
|
->setUserLevel(User::USER_LEVEL_ADMIN)
|
||||||
|
->handle($request->getModel(Server::class), $request->validated());
|
||||||
|
|
||||||
return $this->fractal->item($server)
|
return $this->fractal->item($server)
|
||||||
->transformWith($this->getTransformer(ServerTransformer::class))
|
->transformWith($this->getTransformer(ServerTransformer::class))
|
||||||
|
|
Loading…
Reference in a new issue