Fix up API handling logic for keys and set a prefix on all keys
This commit is contained in:
parent
8605d175d6
commit
b051718afe
11 changed files with 88 additions and 31 deletions
|
@ -3,6 +3,7 @@
|
|||
namespace Pterodactyl\Http\Requests\Api\Application;
|
||||
|
||||
use Webmozart\Assert\Assert;
|
||||
use Pterodactyl\Models\ApiKey;
|
||||
use Laravel\Sanctum\TransientToken;
|
||||
use Illuminate\Validation\Validator;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
@ -45,6 +46,10 @@ abstract class ApplicationApiRequest extends FormRequest
|
|||
return true;
|
||||
}
|
||||
|
||||
if ($token->key_type === ApiKey::TYPE_ACCOUNT) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return AdminAcl::check($token, $this->resource, $this->permission);
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue