2018-02-28 03:28:43 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Requests\Api\Client;
|
|
|
|
|
2020-07-07 04:25:00 +00:00
|
|
|
use Pterodactyl\Models\User;
|
|
|
|
|
2018-02-28 03:28:43 +00:00
|
|
|
class GetServersRequest extends ClientApiRequest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function authorize(): bool
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2020-07-07 04:25:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the filtering method for servers when the client base endpoint is requested.
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getFilterLevel(): int
|
|
|
|
{
|
|
|
|
switch ($this->input('type')) {
|
|
|
|
case 'all':
|
|
|
|
return User::FILTER_LEVEL_ALL;
|
|
|
|
break;
|
|
|
|
case 'admin':
|
|
|
|
return User::FILTER_LEVEL_ADMIN;
|
|
|
|
break;
|
|
|
|
case 'owner':
|
|
|
|
return User::FILTER_LEVEL_OWNER;
|
|
|
|
break;
|
|
|
|
case 'subuser-of':
|
|
|
|
default:
|
|
|
|
return User::FILTER_LEVEL_SUBUSER;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2018-02-28 03:28:43 +00:00
|
|
|
}
|