mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-05 07:52:34 +00:00
Fix filemanager permissions (#508)
* Fix filemanager permissions * fix filemanager permissions * fix tests warning
This commit is contained in:
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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().'*'))
|
||||
|
Reference in New Issue
Block a user