misc_pterodactyl-panel/app/Http/Requests/Api/Application/Nodes/DeleteNodeRequest.php

34 lines
738 B
PHP
Raw Normal View History

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 01:58:57 +00:00
use Pterodactyl\Http\Requests\Api\Application\ApiAdminRequest;
2018-01-13 20:08:19 +00:00
class DeleteNodeRequest extends ApiAdminRequest
{
/**
* @var string
*/
protected $resource = AdminAcl::RESOURCE_NODES;
/**
* @var int
*/
protected $permission = AdminAcl::WRITE;
/**
* Determine if the node being requested for editing exists
* on the Panel before validating the data.
*
* @return bool
*/
public function resourceExists(): bool
{
$node = $this->route()->parameter('node');
return $node instanceof Node && $node->exists;
}
}