feat: add validation methods for S3 bucket names, paths, and server paths; update import logic to prevent command injection

This commit is contained in:
Andras Bacsai
2025-11-25 16:40:35 +01:00
parent 6c030d96f2
commit 9113ed714f
9 changed files with 272 additions and 55 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Policies;
use App\Models\InstanceSettings;
use App\Models\User;
class InstanceSettingsPolicy
{
/**
* Determine whether the user can view the instance settings.
*/
public function view(User $user, InstanceSettings $settings): bool
{
return isInstanceAdmin();
}
/**
* Determine whether the user can update the instance settings.
*/
public function update(User $user, InstanceSettings $settings): bool
{
return isInstanceAdmin();
}
}