2018-01-20 03:47:06 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Requests\Api\Application\Servers;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\Server;
|
|
|
|
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
|
|
|
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
|
|
|
|
|
2018-01-20 19:48:02 +00:00
|
|
|
class ServerWriteRequest extends ApplicationApiRequest
|
2018-01-20 03:47:06 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $resource = AdminAcl::RESOURCE_SERVERS;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
2018-01-20 19:48:02 +00:00
|
|
|
protected $permission = AdminAcl::WRITE;
|
2018-01-20 03:47:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine if the requested server exists on the Panel.
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function resourceExists(): bool
|
|
|
|
{
|
|
|
|
$server = $this->route()->parameter('server');
|
|
|
|
|
|
|
|
return $server instanceof Server && $server->exists;
|
|
|
|
}
|
|
|
|
}
|