From 264c3865b2f93c04dfac0b9b1e25d261cfedc429 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Sat, 6 Mar 2021 15:41:34 -0700 Subject: [PATCH] api(application): fix api key permissions --- app/Transformers/Api/Application/BaseTransformer.php | 2 +- app/Transformers/Api/Application/LocationTransformer.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Transformers/Api/Application/BaseTransformer.php b/app/Transformers/Api/Application/BaseTransformer.php index 5bb664d2b..3fd237d1a 100644 --- a/app/Transformers/Api/Application/BaseTransformer.php +++ b/app/Transformers/Api/Application/BaseTransformer.php @@ -84,7 +84,7 @@ abstract class BaseTransformer extends TransformerAbstract */ protected function authorize(string $resource): bool { - if ($this->isRootAdmin()) { + if ($this->getKey()->key_type === ApiKey::TYPE_ACCOUNT && $this->isRootAdmin()) { return true; } diff --git a/app/Transformers/Api/Application/LocationTransformer.php b/app/Transformers/Api/Application/LocationTransformer.php index 271942b49..eceb0e9e7 100644 --- a/app/Transformers/Api/Application/LocationTransformer.php +++ b/app/Transformers/Api/Application/LocationTransformer.php @@ -37,7 +37,7 @@ class LocationTransformer extends BaseTransformer } /** - * Return the nodes associated with this location. + * Return the servers associated with this location. * * @return \League\Fractal\Resource\Collection|\League\Fractal\Resource\NullResource * @@ -62,7 +62,6 @@ class LocationTransformer extends BaseTransformer * * @throws \Illuminate\Contracts\Container\BindingResolutionException * @throws \Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException - */ public function includeNodes(Location $location) {