mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-01 03:45:53 -05:00
24 lines
602 B
PHP
24 lines
602 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Pterodactyl\Http\Requests\Api\Application\Nodes;
|
|
|
|
use Pterodactyl\Models\ApiKey;
|
|
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
|
|
|
/**
|
|
* Reading a node's configuration returns its daemon token, so it needs write access to nodes.
|
|
*/
|
|
class GetNodeConfigurationRequest extends GetNodesRequest
|
|
{
|
|
protected int $permission = AdminAcl::WRITE;
|
|
|
|
public function authorize(): bool
|
|
{
|
|
$token = $this->user()?->currentAccessToken();
|
|
|
|
return (! $token instanceof ApiKey || $token->key_type !== ApiKey::TYPE_ACCOUNT) && parent::authorize();
|
|
}
|
|
}
|