add ability to show backups to superadmins

This commit is contained in:
nurmuhammet committed 2023-12-14 20:23:27 +05:00
1 parent c242d48e06
commit 382317f1ae
3 files changed
+11 -2

No files matched your search

+2 -1
View File
@@ -9,6 +9,7 @@
use App\Repos\System\Settings\Location\RegionRepo;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Password;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Textarea;
@@ -88,7 +89,7 @@ public function fields(NovaRequest $request): array
Text::make(__('Billing username'), 'billing_username')
->rules('nullable', 'string', 'max:255'),
Text::make(__('Billing password'), 'billing_password')
Password::make(__('Billing password'), 'billing_password')
->rules('nullable', 'string', 'max:255'),
Textarea::make(__('Address'), 'address'),
+1 -1
View File
@@ -98,7 +98,7 @@ public function tools(): array
->onSwitchLocale(NovaRepo::localeSwitcherSave()),
BackupTool::make()
->canSee(NovaRepo::isMe()),
->canSee(NovaRepo::isAdmin()),
LogsTool::make()
->canSee(NovaRepo::isMe())
+8
View File
@@ -83,6 +83,14 @@ public static function isMe(): Closure
return fn () => Gate::allows('isMe', auth()->user());
}
/**
* Check if user is admin
*/
public function isAdmin(): Closure
{
return fn () => Gate::allows('isAdmin', auth()->user());
}
/**
* Readonly only on "update" pages
*/