Fix filemanager permissions (#508)

* Fix filemanager permissions

* fix filemanager permissions

* fix tests warning
This commit is contained in:
Saeed Vaziry
2025-02-26 20:46:07 +01:00
committed by GitHub
parent e17fdbb1a0
commit 3bf3f7eebc
12 changed files with 56 additions and 55 deletions

View File

@ -14,7 +14,7 @@ class Index extends Page
public function mount(): void
{
$this->authorize('update', $this->server);
$this->authorize('manage', $this->server);
}
public function getWidgets(): array

View File

@ -269,9 +269,10 @@ protected function uploadAction(): Action
->after(function (array $data) {
run_action($this, function () use ($data) {
foreach ($data['file'] as $file) {
$this->server->ssh($this->serverUser)->upload(
$this->server->ssh()->upload(
Storage::disk('tmp')->path($file),
$this->path.'/'.$file,
$this->serverUser
);
}
$this->refresh();

View File

@ -60,7 +60,7 @@ public function getSubNavigation(): array
->url(DatabasesIndex::getUrl(parameters: ['server' => $this->server]));
}
if (auth()->user()->can('update', $this->server)) {
if (auth()->user()->can('manage', $this->server)) {
$items[] = NavigationItem::make(FileManagerIndex::getNavigationLabel())
->icon('heroicon-o-folder')
->isActiveWhen(fn () => request()->routeIs(FileManagerIndex::getRouteName().'*'))