File tree Expand file tree Collapse file tree 4 files changed +24
-16
lines changed
Controllers/Api/Application/Servers
Requests/Api/Application/Servers Expand file tree Collapse file tree 4 files changed +24
-16
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
88* Fixes an exception thrown when trying to access the ` /nests/:id/eggs/:id ` API endpoint.
99* Fixes search on server listing page.
1010* Schedules with no names are now clickable to allow editing.
11+ * Fixes broken permissions check that would deny access to API keys that did in fact have permission.
1112
1213### Added
1314* Adds ability to include egg variables on an API request.
Original file line number Diff line number Diff line change 99use Pterodactyl \Services \Servers \ServerDeletionService ;
1010use Pterodactyl \Contracts \Repository \ServerRepositoryInterface ;
1111use Pterodactyl \Transformers \Api \Application \ServerTransformer ;
12+ use Pterodactyl \Http \Requests \Api \Application \Servers \GetServerRequest ;
1213use Pterodactyl \Http \Requests \Api \Application \Servers \GetServersRequest ;
1314use Pterodactyl \Http \Requests \Api \Application \Servers \ServerWriteRequest ;
1415use Pterodactyl \Http \Requests \Api \Application \Servers \StoreServerRequest ;
@@ -91,10 +92,10 @@ public function store(StoreServerRequest $request): JsonResponse
9192 /**
9293 * Show a single server transformed for the application API.
9394 *
94- * @param \Pterodactyl\Http\Requests\Api\Application\Servers\ServerWriteRequest $request
95+ * @param \Pterodactyl\Http\Requests\Api\Application\Servers\GetServerRequest $request
9596 * @return array
9697 */
97- public function view (ServerWriteRequest $ request ): array
98+ public function view (GetServerRequest $ request ): array
9899 {
99100 return $ this ->fractal ->item ($ request ->getModel (Server::class))
100101 ->transformWith ($ this ->getTransformer (ServerTransformer::class))
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Pterodactyl \Http \Requests \Api \Application \Servers ;
4+
5+ use Pterodactyl \Services \Acl \Api \AdminAcl ;
6+ use Pterodactyl \Http \Requests \Api \Application \ApplicationApiRequest ;
7+
8+ class GetServerRequest extends ApplicationApiRequest
9+ {
10+ /**
11+ * @var string
12+ */
13+ protected $ resource = AdminAcl::RESOURCE_SERVERS ;
14+
15+ /**
16+ * @var int
17+ */
18+ protected $ permission = AdminAcl::READ ;
19+ }
Original file line number Diff line number Diff line change 22
33namespace Pterodactyl \Http \Requests \Api \Application \Servers ;
44
5- use Pterodactyl \Services \Acl \Api \AdminAcl ;
6- use Pterodactyl \Http \Requests \Api \Application \ApplicationApiRequest ;
7-
8- class GetServersRequest extends ApplicationApiRequest
5+ class GetServersRequest extends GetServerRequest
96{
10- /**
11- * @var string
12- */
13- protected $ resource = AdminAcl::RESOURCE_SERVERS ;
14-
15- /**
16- * @var int
17- */
18- protected $ permission = AdminAcl::READ ;
19-
207 /**
218 * @return array
229 */
You can’t perform that action at this time.
0 commit comments