32 lines
717 B
PHP
32 lines
717 B
PHP
<?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;
|
|
|
|
class ServerWriteRequest extends ApplicationApiRequest
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $resource = AdminAcl::RESOURCE_SERVERS;
|
|
|
|
/**
|
|
* @var int
|
|
*/
|
|
protected $permission = AdminAcl::WRITE;
|
|
|
|
/**
|
|
* 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;
|
|
}
|
|
}
|