Switch file manager listing to use panel API endpoint

This commit is contained in:
Dane Everitt 2019-05-01 20:54:40 -07:00
parent e87c5f6657
commit c80c8564b8
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
8 changed files with 156 additions and 8 deletions

View file

@ -0,0 +1,20 @@
<?php
namespace Pterodactyl\Http\Requests\Api\Client\Servers\Files;
use Pterodactyl\Models\Server;
use Pterodactyl\Http\Requests\Api\Client\ClientApiRequest;
class ListFilesRequest extends ClientApiRequest
{
/**
* Check that the user making this request to the API is authorized to list all
* of the files that exist for a given server.
*
* @return bool
*/
public function authorize(): bool
{
return $this->user()->can('list-files', $this->getModel(Server::class));
}
}