misc_pterodactyl-panel/app/Http/Requests/Api/Application/Allocations/GetAllocationsRequest.php

25 lines
669 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\Allocations;
2018-01-13 20:08:19 +00:00
use Pterodactyl\Models\Node;
use Pterodactyl\Services\Acl\Api\AdminAcl;
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
2018-01-13 20:08:19 +00:00
class GetAllocationsRequest extends ApplicationApiRequest
2018-01-13 20:08:19 +00:00
{
2021-01-24 01:17:35 +00:00
protected string $resource = AdminAcl::RESOURCE_ALLOCATIONS;
protected int $permission = AdminAcl::READ;
2018-01-13 20:08:19 +00:00
/**
* Determine if the node that we are requesting the allocations
* for exists on the Panel.
*/
public function resourceExists(): bool
{
$node = $this->route()->parameter('node');
return $node instanceof Node && $node->exists;
}
}