2018-01-13 20:08:19 +00:00
|
|
|
<?php
|
|
|
|
|
2018-01-20 01:58:57 +00:00
|
|
|
namespace Pterodactyl\Http\Requests\Api\Application\Nodes;
|
2018-01-13 20:08:19 +00:00
|
|
|
|
|
|
|
use Pterodactyl\Models\Node;
|
|
|
|
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
2018-01-20 03:47:06 +00:00
|
|
|
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
|
2018-01-13 20:08:19 +00:00
|
|
|
|
2018-01-20 03:47:06 +00:00
|
|
|
class DeleteNodeRequest extends ApplicationApiRequest
|
2018-01-13 20:08:19 +00:00
|
|
|
{
|
2021-01-24 01:17:35 +00:00
|
|
|
protected string $resource = AdminAcl::RESOURCE_NODES;
|
|
|
|
protected int $permission = AdminAcl::WRITE;
|
2018-01-13 20:08:19 +00:00
|
|
|
|
|
|
|
public function resourceExists(): bool
|
|
|
|
{
|
|
|
|
$node = $this->route()->parameter('node');
|
|
|
|
|
|
|
|
return $node instanceof Node && $node->exists;
|
|
|
|
}
|
|
|
|
}
|