Skip to content

Commit 070239a

Browse files
committed
Fix inability to edit certain environment vars and start line, closes pterodactyl#1008
1 parent 85bdbdc commit 070239a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
88
* Fixes a bug when reinstalling a server that would not mark the server as installing, resulting in some UI issues.
99
* Handle 404 errors from missing models in the application API bindings correctly.
1010
* Fix validation error returned when no environment variables are passed, even if there are no variables required.
11+
* Fix improper permissions on `PATCH /api/servers/<id>/startup` endpoint which was preventing enditing any start variables.
1112

1213
### Added
1314
* Adds back client API for sending commands or power toggles to a server though the Panel API: `/api/client/servers/<identifier>`

app/Http/Controllers/Api/Application/Servers/StartupController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Pterodactyl\Http\Controllers\Api\Application\Servers;
44

5+
use Pterodactyl\Models\User;
56
use Pterodactyl\Models\Server;
67
use Pterodactyl\Services\Servers\StartupModificationService;
78
use Pterodactyl\Transformers\Api\Application\ServerTransformer;
@@ -40,7 +41,9 @@ public function __construct(StartupModificationService $modificationService)
4041
*/
4142
public function index(UpdateServerStartupRequest $request): array
4243
{
43-
$server = $this->modificationService->handle($request->getModel(Server::class), $request->validated());
44+
$server = $this->modificationService
45+
->setUserLevel(User::USER_LEVEL_ADMIN)
46+
->handle($request->getModel(Server::class), $request->validated());
4447

4548
return $this->fractal->item($server)
4649
->transformWith($this->getTransformer(ServerTransformer::class))

0 commit comments

Comments
 (0)