33 lines
729 B
PHP
33 lines
729 B
PHP
<?php
|
|
|
|
namespace Pterodactyl\Http\Requests\API\Admin\Allocations;
|
|
|
|
use Pterodactyl\Models\Node;
|
|
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
|
use Pterodactyl\Http\Requests\API\Admin\ApiAdminRequest;
|
|
|
|
class GetAllocationsRequest extends ApiAdminRequest
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $resource = AdminAcl::RESOURCE_ALLOCATIONS;
|
|
|
|
/**
|
|
* @var int
|
|
*/
|
|
protected $permission = AdminAcl::READ;
|
|
|
|
/**
|
|
* Determine if the node that we are requesting the allocations
|
|
* for exists on the Panel.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function resourceExists(): bool
|
|
{
|
|
$node = $this->route()->parameter('node');
|
|
|
|
return $node instanceof Node && $node->exists;
|
|
}
|
|
}
|