2020-07-14 21:16:49 -07:00
|
|
|
<?php
|
|
|
|
|
|
2024-03-12 22:39:16 -04:00
|
|
|
namespace App\Http\Requests\Api\Client\Servers\Files;
|
2020-07-14 21:16:49 -07:00
|
|
|
|
2024-03-12 22:39:16 -04:00
|
|
|
use App\Models\Permission;
|
|
|
|
|
use App\Http\Requests\Api\Client\ClientApiRequest;
|
2020-07-14 21:16:49 -07:00
|
|
|
|
|
|
|
|
class DecompressFilesRequest extends ClientApiRequest
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Checks that the authenticated user is allowed to create new files for the server. We don't
|
|
|
|
|
* rely on the archive permission here as it makes more sense to make sure the user can create
|
|
|
|
|
* additional files rather than make an archive.
|
|
|
|
|
*/
|
|
|
|
|
public function permission(): string
|
|
|
|
|
{
|
|
|
|
|
return Permission::ACTION_FILE_CREATE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function rules(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'root' => 'sometimes|nullable|string',
|
|
|
|
|
'file' => 'required|string',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|