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

34 lines
741 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;
2018-01-20 01:58:57 +00:00
use Pterodactyl\Http\Requests\Api\Application\ApiAdminRequest;
2018-01-13 20:08:19 +00:00
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;
}
}